Making mktemp compatible with linux and osx; Adding -f to rm of temp dir