Fixup two buglets in queries.