Fix some tcp issues