Add replicator test.
Fix regressions.