Fixed a bug in the delete of permissions.