Fixed query bugs for list views