Switched from tempfile to mktemp