Just stumbled across this post after days of rewriting replication code - this was the problem after all! Thank you