more tcp fixes and tweaks

Ignore-this: 357b176e1c11eb68c8de948ab66a990a

darcs-hash:20140116193912-c21fe-fa32d5426509c6385307582351ca39b69c83eef7