Fix issues saving and removing roles and permissions.