Fix handling of Ctrl-C
Merge pull request #146 from net147/master

Fix handling of Ctrl-C