Grouping bug fix