Fix permission issue with writing to mod files