Fixed #14334 -- Ensured that query comparision objects are of correct type.