Thanks for the suggestions, jctcom.
I don't have any tracks linked anywhere in my library, so it's not that.
As I said in my original post, the code I have used to work perfectly with MC version 30 and prior, but not having used the smartlist in a while, at least since I upgraded to version 31 when it was first released, I didn't notice that the smartlist results had changed.