Fix bugs in new replicator.