Improved temp dir creation