Fix issues in tcp sockets and peerconnection.