Fixed clean up of temp files