Fixed file permissions for intermediate directories.