Fix permissions

Ensure that permissions are the expected ones for both directories and files and that user can enter the created directories.