Fix tcp_connect by Mons's review.