Fix replication test

Depends on #1379