Unnecessary tmp files are removed