Fix file permissions

Resubmit of pull #8