Fixed createTmpDir() logic.