Set file permissions correctly.