Create files with the correct permission instead of changing it afterwards.

Not intended functionality change.