Fixed some small bugs in telnet