small fixes to replication