Fixing unintended change in GroupManager. Added unit tests.