Properly clean up temp files