autoManageGroups() now removes groups before setting them