anchor.diff:  
   handle_info({update_docs, Client, GroupedDocs, NonRepDocs, MergeConflicts,
           FullCommit}, Db) ->
  -    GroupedDocs2 = maybe_tag_grouped_docs(Client, GroupedDocs),
  +    GroupedDocs2 = sort_and_tag_grouped_docs(Client, GroupedDocs),
       if NonRepDocs == [] ->
           {GroupedDocs3, Clients, FullCommit2} = collect_updates(GroupedDocs2,
                   [Client], MergeConflicts, FullCommit);
  
positive.code: code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  maybe_tag_grouped_docs(Client, GroupedDocs) ->
      lists:map(fun(DocGroup) ->
          [{Client, maybe_tag_doc(D)} || D <- DocGroup]
      end, GroupedDocs).
  
  maybe_tag_doc(#doc{id=Id, revs={Pos,[_Rev|PrevRevs]}, meta=Meta0}=Doc) ->
      case lists:keymember(ref, 1, Meta0) of
  
negative.code:         % updaters than deal with their possible conflicts, and local docs
          % writes are relatively rare. Can be optmized later if really needed.
          {update_docs, Client, GroupedDocs, [], MergeConflicts, FullCommit2} ->
              GroupedDocs2 = sort_and_tag_grouped_docs(Client, GroupedDocs),
              GroupedDocsAcc2 =
                  merge_updates(GroupedDocsAcc, GroupedDocs2),
              collect_updates(GroupedDocsAcc2, [Client | ClientsAcc],
  