diff --git a/pcl_expect.py b/pcl_expect.py
index 8c8e90f3d9ba41bb3901601e5f42f10adb83e7ce..bb8d3bcea65c949b70c5cda8f1ace80dbcc6294e 100644
--- a/pcl_expect.py
+++ b/pcl_expect.py
@@ -154,6 +154,7 @@ class spawn(expectable):
 class telnet(expectable):
     def __init__(self, host, port):
         self.telnet = telnetlib.Telnet(host, port)
+        expectable.__init__(self, self.telnet.fileno())
 
     def _read(self):
         try:
@@ -165,8 +166,8 @@ class telnet(expectable):
     def send(self, s):
         self.telnet.write(s)
 
-    def fileno(self):
-        return self.telnet.fileno()
+    def close(self):
+        self.telnet.close()
 
 class impl:
     def __init__(self, timeout = None):
@@ -262,8 +263,8 @@ class impl:
 
         self.__fill_buffer(exp)
 
-        debug("does \"%s\" match \"%s\" (fd %d)?" % (
-            exp.buffer(), regexp, exp.fileno()))
+        debug("does %s match %s (fd %d)?" % (
+            repr(exp.buffer()), repr(regexp), exp.fileno()))
 
         # Doing this compilation again and again could be a problem.
         # I rely on the cache in module re.  I hope it exists...