Made telnet exit gracefully