Handle temp files better