Some cleanup for TCP stuff