FIxes bug with creating files in non-existent directory