Fix bugs in replication document