Fix tempdir directory creation