Improved TCP handling.