Ensure that permissions are set after creating a file
Fix chown issues
Merge branch 'master' into next