Adding ability to correctly terminate command mid-run.