Handling ctrl-c more cleanly.