Minor fix for temp files in optimisation mode.