anchor.diff:      _ ->
           % Might not succeed - when the replication doc is deleted right
           % before this update (not an error, ignore).
  -        spawn_link(fun() ->
  -            fabric:update_doc(RepDbName, RepDoc#doc{body = {NewRepDocBody}}, [?CTX])
  -        end)
  +        fabric:update_doc(RepDbName, RepDoc#doc{body = {NewRepDocBody}}, [?CTX])
       end.
   
   % RFC3339 timestamps.
  
positive.code:                 _ ->
                      ok
              end
          catch throw:conflict ->
              % Shouldn't happen, as by default only the role _replicator can
              % update replication documents.
              twig:log(error, "Conflict error when updating replication document `~s`."
                  " Retrying.", [RepDocId]),
              ok = timer:sleep(5),
              update_rep_doc(RepDbName, RepDocId, KVs)
          end
      end);
  
  update_rep_doc(RepDbName, #doc{body = {RepDocBody}} = RepDoc, KVs) ->
      NewRepDocBody = lists:foldl(
  
negative.code: 
  
  update_rep_doc(RepDbName, RepDocId, KVs) when is_binary(RepDocId) ->
      {Pid, Ref} =
      spawn_monitor(fun() ->
          try
              case fabric:open_doc(mem3:dbname(RepDbName), RepDocId, []) of
                  {ok, LatestRepDoc} ->
  