Fix wrong query condition.