Fixed a deleting tmp files problem.