Changed the way groups are removed in autoManageGroups()