make TMPDIR setup more robust.