Fixed a TypeError issue when running the 'update_permissions' command