Fix function clause/badrecord when retrying DC replication