Fix some bugs in TestCtrlC