Robust kill

PR for #7. Please merge #15 before this PR.