fixed a few bugs in the TCP subsystem, mainly regarding ping/pong