Some fixes to permissions.