Fixed incorrect logic to fix tmp directory path.