Remove temp files correctly