Fix a bug in TCP replication.