Added more graceful handling of KeyboardInterrupt (Ctrl + C)