Fix queries with && or || operators