Fix file encodings and permissions.