Use tempfile instead of making temp files.