use TMPDIR instead of --tmpdir option in mktemp to make it more portable; closes #30