Bugfix for temp file creation