Upgrade to new permissions format (Array)
Fix some factories