Fix unit test failure caused by the order of Done and Terminated message
Merge pull request #136 from zhangce/master

Fix unit test failure caused by the order of Done and Terminated message