Improvements to TCP tests