Added extra check for unexpected behavior on group memberships. Fixes #21.