some fixes to tcp snippets.