fixes groups in permissions form and fixes #1552