Add test for group/single-user permission
Single User + groups profiles now work together.

Improve #46.
fix potential crash and add test for it