Add some unit tests for replication.