Fix problems with grouping switch