Fixed issues with tempdir folder creation