anchor.diff:      {reply, ok, State#state { locks=NewLocks1 }};
   
   handle_call({fold, Fun, Acc}, _From, State) ->
  -    #state { indexes=Indexes, fields=Fields, terms=Terms, buffers=Buffers, segments=Segments } = State,
  -    
  -    %% Reverse the incdexes. Normally, they map "Value" to ID.  The
  -    %% invert/1 command returns a gbtree mapping ID to "Value".
  -    InvertedIndexes = mi_incdex:invert(Indexes),
  -    InvertedFields = mi_incdex:invert(Fields),
  -    InvertedTerms = mi_incdex:invert(Terms),
  +    #state { buffers=Buffers, segments=Segments } = State,
   
       %% Create the fold function.
       WrappedFun = fun({IFT, Value, Props, TS}, AccIn) ->
  -        %% Look up the Index, Field, and Term...
  -        {IndexID, FieldID, TermID} = mi_utils:ift_unpack(IFT),
  -        {value, Index} = gb_trees:lookup(IndexID, InvertedIndexes),
  -        {value, Field} = gb_trees:lookup(FieldID, InvertedFields),
  -        {value, Term} = gb_trees:lookup(TermID, InvertedTerms),
  -
  -        %% Call the fold function...
  -        Fun(Index, Field, Term, Value, Props, TS, AccIn)
  -    end,
  +                         %% Look up the Index, Field, and Term...
  +                         {Index, Field, Term} = mi_ift_server:reverse_ift(IFT),
  +
  +                         %% Call the fold function...
  +                         Fun(Index, Field, Term, Value, Props, TS, AccIn)
  +                 end,
   
       %% Fold over each buffer...
       F1 = fun(Buffer, AccIn) ->
  
positive.code: 
  handle_call({index, Index, Field, Term, Value, Props, TS}, _From, State) ->
      %% Calculate the IFT...
      #state { indexes=Indexes, fields=Fields, terms=Terms, buffers=[CurrentBuffer0|Buffers] } = State,
      {IndexID, NewIndexes} = mi_incdex:lookup(Index, Indexes),
      {FieldID, NewFields} = mi_incdex:lookup(Field, Fields),
      {TermID, NewTerms} = mi_incdex:lookup(Term, Terms),
      IFT = mi_utils:ift_pack(IndexID, FieldID, TermID),
  
      %% Write to the buffer...
      CurrentBuffer = mi_buffer:write(IFT, Value, Props, TS, CurrentBuffer0),
  
      %% Update the state...
      NewState = State#state {
          indexes=NewIndexes,
          fields=NewFields,
          terms=NewTerms,
          buffers=[CurrentBuffer|Buffers]
      },
  
      %% Add a small delay if we are sitting on too many segments. This
      %% provides a sort of automated throttling, giving the compactor
      %% time to merge segments.
      %% TODO - Make this configurable. It would be useful to
      %% turn this off for bulk loading.
      %% TODO - Reevaluate whether sleeping here is a good idea.
  
      %% Possibly dump buffer to a new segment...
      case mi_buffer:filesize(CurrentBuffer) > ?ROLLOVER_SIZE(NewState) of
  
negative.code:     %% Get incdex and buffer options...
      TempState = #state { config=Config },
      SyncInterval = ?SYNC_INTERVAL(TempState),
      BufferOptions = [{write_interval, SyncInterval}],
      
      %% Load from disk...
  