anchor.diff:          end, RevInfosAndPath),
       [{_RevInfo, WinPath}|_] = SortedRevInfosAndPath,
       RevInfos = [RevInfo || {RevInfo, _Path} <- SortedRevInfosAndPath],
  -    {#doc_info{id=Id, high_seq=max_seq(Tree), revs=RevInfos}, WinPath}.
  +    {#doc_info{id=Id, high_seq=max_seq(Tree, Seq), revs=RevInfos}, WinPath}.
   
   
   
  
positive.code:     {DocInfo, _Path} = to_doc_info_path(FullDocInfo),
      DocInfo.
  
  max_seq(Tree) ->
      FoldFun = fun({_Pos, _Key}, Value, _Type, MaxOldSeq) ->
          case Value of
              {_Deleted, _DiskPos, OldTreeSeq} ->
  
negative.code:                 MaxOldSeq
          end
      end,
      couch_key_tree:fold(FoldFun, UpdateSeq, Tree).
  
  to_doc_info_path(#full_doc_info{id=Id,rev_tree=Tree,update_seq=Seq}) ->
      RevInfosAndPath = [
          {#rev_info{
              deleted = element(1, LeafVal),
  