Fixed signal handling so that CTRL-C works as expected from terminal window.