Temp file generation fix