fixing some grouping problems