Fix some bugs running replication sync tasks on a particular dataset