Tweak handling of "any" queries