fix small bugs
fix indention
Merge pull request #2 from boatswain/master

delete temporary files when some task failed.