anchor.diff:  
   
   update_rep_doc(RepDbName, RepDocId, KVs) when is_binary(RepDocId) ->
  -    spawn_link(fun() ->
  +    {Pid, Ref} =
  +    spawn_monitor(fun() ->
           try
               case fabric:open_doc(mem3:dbname(RepDbName), RepDocId, []) of
                   {ok, LatestRepDoc} ->
  
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:     _ ->
          % Might not succeed - when the replication doc is deleted right
          % before this update (not an error, ignore).
          fabric:update_doc(RepDbName, RepDoc#doc{body = {NewRepDocBody}}, [?CTX])
      end.
  
  % RFC3339 timestamps.
  