Fixed a bug in tcp connections.