Use tmpdir instead of /tmp for windows compatability