Fix some bugs in TCP/Rational