Fix terminate() and add kill()
Added test case
Merge pull request #1620 from trustable-code/PR6

Fix terminate() and add kill()