Fix permission values and line endings