Fixed the mktemp calls