Fix sql replication skipping first item of batches