Fixed shell thread killing in CLI