Media permission flags migration. Fix bug in install generator.