Replication fix and test speedup