Fixed storage location of temporary files

(previously it was saving them in the user's home folder on OS X)