Handle ^C and IOErrors.