corrections in Misc.writeToFilePath()