Some fixed to group_by method