anchor.diff:  -spec add_terms(index_terms(), term(), #state{}) -> {overload_state(), #state{}}.
   add_terms(NewTerms, From, State) ->
       UpdTerms = State#state.terms ++ NewTerms,
  -    UpdNumTerms = State#state.num_terms + length(NewTerms),
  +    NumNewTerms = length(NewTerms),
  +    UpdNumTerms = State#state.num_terms + NumNewTerms,
       case UpdNumTerms < State#state.overload_thresh of
           true ->
               {ok, State#state{terms = UpdTerms,
  
positive.code: %% Send the next batch of terms
  -spec send_batch(#state{}) -> {statename(), #state{}}.
  send_batch(#state{terms=[]}=State) ->
      gen_fsm:send_event(self(), empty),
      {idle, State};
  send_batch(State) ->
      {Rest, PlTerms, TermCount} = lookup_preflist(State#state.batch_size,
                                                   0,
  
negative.code:             {StateName, NewState} = send_batch(State),
              {next_state, StateName, NewState};
          RepliesLeft ->
              {next_state, receiving, State#state{acks = Acks + 1,
                                                  replies_left = RepliesLeft}}
      end;
  receiving({Ref, recv_timeout}, #state{timeouts=Timeouts,ref=Ref} = State) ->    
      %% Receive timeout for current batch - for now just continue
      %% on to the next batch
      {StateName, NewState} = send_batch(State#state{timeouts=Timeouts+1,
                                                     timer=undefined}),
      {next_state, StateName, NewState};
  
  receiving({_Ref, {indexed, _Node}}, State) ->
      %% Ignore stale reply from previous batch
      {next_state, receiving, State};
  receiving(empty, State) ->
  