Fixed query clause ordering.