(#2018) - Fix deletion handling during replication
(#2018) - Follow up refactor