Fix path detect for temp dir