anchor.diff:                             true ->
                                  S = config:read(lb_active_gossip_stddev_threshold),
                                  DhtSize = proplists:get_value(dht_size, Options),
  -                               StdDev =
  -                                   if Metric =:= items ->
  -                                          proplists:get_value(stddevItems, Options);
  -                                      Metric =:= requests ->
  -                                          proplists:get_value(stddevRequests, Options)
  -                                   end,
  +                               case Metric of
  +                                   items ->
  +                                       Avg = AvgItems,
  +                                       StdDev = proplists:get_value(stddevItems, Options);
  +                                   requests ->
  +                                       Avg = AvgRequests,
  +                                       StdDev = proplists:get_value(stddevRequests, Options)
  +                               end,
                                  Variance = StdDev * StdDev,
                                  VarianceChange =
                                      case JumpOrSlide of
  
positive.code:                                    end,
                                 VarianceNew = Variance + VarianceChange,
                                 StdDevNew = ?IIF(VarianceNew >= 0, math:sqrt(VarianceNew), StdDev),
                                 ?TRACE("New StdDev: ~p Old StdDev: ~p Metric: ~p~n", [StdDevNew, StdDev, Metric]),
                                 StdDevNew < StdDev * (1 - S / DhtSize);
                             %% gossip not available, skipping this test
                             false -> true
                         end,
  
negative.code:                case gossip_available(Options) of
                     true -> AvgItems = proplists:get_value(avgItems, Options),
                             AvgRequests = proplists:get_value(avgRequests, Options),
                             %% don't take away more than the average to avoid making the light node heavy
                             {?IIF(ProposedTargetLoadItems > AvgItems,
                                   trunc(AvgItems), ProposedTargetLoadItems),
                              ?IIF(ProposedTargetLoadRequests > AvgRequests,
                                   trunc(AvgRequests), ProposedTargetLoadRequests)
                             };
                     false -> AvgItems = 0, AvgRequests = 0,
                              {ProposedTargetLoadItems, ProposedTargetLoadRequests}
                 end,
  
             {From, To, Direction} =
  