anchor.diff:                  {ok, <<2:16/?SIZE_TYPE, FileSize:64/?SIZE_TYPE, R/binary>>} ->
                       Set = do_fold_idx(IO, Chunk,
                                        fun({entry, M}, Acc) ->
  -                                             btrie:append(M, t, Acc)
  +                                             btrie:store(M, Acc)
                                        end, btrie:new(), R),
                       {ok, FileSize, 8, Set};
                   {ok, <<?VERSION:16/?SIZE_TYPE, FileSize:64/?SIZE_TYPE,
                          DataSize:64/?SIZE_TYPE, R/binary>>} ->
                       Set = do_fold_idx(IO, Chunk,
                                        fun({entry, M}, Acc) ->
  -                                             btrie:append(M, t, Acc)
  +                                             btrie:store(M, Acc)
                                        end, btrie:new(), R),
                       {ok, FileSize, DataSize, Set};
                   {ok, _} ->
  
positive.code:         case btrie:find(Metric, Idx) of
              error ->
                  Pos = M#mfile.next,
                  Mx = M#mfile{next=Pos+1, index=btrie:append(Metric, Pos, Idx)},
                  file:write_file([M#mfile.name | ".idx"],
                                  <<(byte_size(Metric)):16/integer, Metric/binary>>,
                                  [read, append]),
                  {Mx, Pos*S*DataSize};
              {ok, [Pos]} ->
                  {M,Pos*S*DataSize}
          end,
      P = Base+((Position - Offset)*DataSize),
  
negative.code:     fold_idx(fun({init, Offset, Size}, undefined) ->
                       {Offset, Size, btrie:new(), 0};
                  ({entry, M}, {Offset, Size, T, I}) ->
                       {Offset, Size, btrie:store(M, I, T), I+1}
               end, undefined, F).
  fold_idx(Fun, Acc0, F) ->
      fold_idx(Fun, Acc0, 4*1024, F).
  