anchor.diff:      LeastRestPos = [Pos || {Mbr, Pos} <- LeastRest],
       case insert_subtree(Fd, LeastPos, Subtree, Level, Depth+1) of
       {ok, NewMbr, NewPos, Inc} ->
  +?debugVal(length([NewPos|LeastRestPos])),
           MergedMbr = vtree:merge_mbr(ParentMbr, NewMbr),
           NewNode = {MergedMbr, #node{type=inner}, [NewPos|LeastRestPos]},
           {ok, Pos} = couch_file:append_term(Fd, NewNode),
  +?debugVal(Pos),
           {ok, NewMbr, Pos, Inc};
       {splitted, ChildMbr, {Child1Mbr, ChildPos1}, {Child2Mbr, ChildPos2}, Inc} ->
           MergedMbr = vtree:merge_mbr(ParentMbr, ChildMbr),
  
positive.code:             Children = [{Mbr, Meta, Pos} || {{Mbr, Meta, _}, Pos} <-
                      lists:zip(load_nodes(Fd, LeastRestPos), LeastRestPos)],
              Children2 = [Child1, Child2] ++ Children,
  
              {SplittedMbr, {Node1Mbr, _, _}=Node1, {Node2Mbr, _, _}=Node2}
                      = vtree:split_node({MergedMbr, #node{type=inner}, Children2}),
              {ok, Pos1} = couch_file:append_term(Fd, Node1),
              {ok, Pos2} = couch_file:append_term(Fd, Node2),
              {splitted, SplittedMbr, {Node1Mbr, Pos1}, {Node2Mbr, Pos2}, Inc}
          end
      end.
  
negative.code:     length(ChildrenPos) =< ?MAX_FILLED ->
          NewNode = {MergedMbr, ParentMeta, ChildrenPos},
          {ok, Pos} = couch_file:append_term(Fd, NewNode),
  ?debugVal(Pos),
          {ok, MergedMbr, Pos, 0};
      true ->
  ?debugVal(length(ChildrenPos)),
          %io:format("We need to split (leaf node)~n~p~n", [LeafNode]),
          Children = load_nodes(Fd, ChildrenPos),
  
          % Transform the the nodes, so that we don't need to write them again.
          % They are now a tuple with their MBR, Meta and *their* position
          % in the file (as opposed to the position of their children)
          Children2 = [{Mbr, Meta, Pos} || {{Mbr, Meta, _}, Pos} <-
                  lists:zip(Children, ChildrenPos)],
  
          % The maximum number of nodes can be 2*MAX_FILLED, therefore we can't
          % use the Ang/Tan split algorithm, but use the OMT algorithm to split
          % the nodes into two partitions.
          {[Part1, Part2], _OmtHeight} = omt_load(Children2, ?MAX_FILLED),
  
          Mbr1 = vtree:calc_nodes_mbr(Part1),
          Mbr2 = vtree:calc_nodes_mbr(Part2),
          % Get the original position in file of the nodes
          Part1Pos = [Pos || {_Mbr, _Meta, Pos} <- Part1],
          Part2Pos = [Pos || {_Mbr, _Meta, Pos} <- Part2],
          Node1 =  {Mbr1, #node{type=inner}, Part1Pos},
          Node2 =  {Mbr2, #node{type=inner}, Part2Pos},
          {ok, Pos1} = couch_file:append_term(Fd, Node1),
          {ok, Pos2} = couch_file:append_term(Fd, Node2),
  
          {splitted, MergedMbr, {Mbr1, Pos1}, {Mbr2, Pos2}, 0}
      end;
  insert_subtree(Fd, RootPos, Subtree, Level, Depth) ->
      %{SubtreeMbr, SubtreePos} = Subtree,
  