Fix handling of Ctrl-C