Fix group_by predicate