Fixed another bug in the tcp handler.