Fixed problems with groupings