This was more serious than it looked - the problem message shouldn't have appeared even once. It had to do with "unique" in the filtering line being read as a predicate applied to objects (by default) and not numbers (as the typechecker had wanted). In some bizarre cases, this could result in the wrong behaviour at run-time.