Further corrections, keyboard interrupt handling corrected.