anchor.diff:    when Time - _L > _Max ->
       metric:mput(Nodes, Dict, W),
       {ok, CBin} = riak_core_ring_manager:get_chash_bin(),
  -    Nodes = chash:nodes(chashbin:to_chash(CBin)),
  -    Nodes1 = [{I, riak_core_apl:get_apl(I, State#sstate.n, metric)}
  -              || {I, _} <- Nodes],
  -    State1 = State#sstate{nodes = Nodes1, cbin = CBin},
  +    Nodes1 = chash:nodes(chashbin:to_chash(CBin)),
  +    Nodes2 = [{I, riak_core_apl:get_apl(I, State#sstate.n, metric)}
  +              || {I, _} <- Nodes1],
  +    State1 = State#sstate{nodes = Nodes2, cbin = CBin, last=Time},
       Dict1 = insert_metric(State, dict:new(), Metric, Time, Points),
       stream_loop(Socket, Transport, State1, Dict1, Rest);
   
  
positive.code:                     lager:error("[tcp] Fast loop cancled because of: ~p.", [E]),
                      loop(Socket, Transport, State, Loop - 1)
              end;
          {ok, <<?STREAM, _BS:?BUCKET_SS/integer, Bucket:_BS/binary, D:8>>} ->
              lager:info("[tcp] Entering stream mode for bucket '~s' "
                         "and a max delay of: ~p", [Bucket, D]),
              ok = Transport:setopts(Socket, [{packet, 0}]),
              stream_loop(Socket, Transport,
                          #sstate{
                             n = State#state.n,
                             w = State#state.n,
                             max_diff = D,
                             bucket = Bucket},
                         dict:new(), <<>>);
          {error, timeout} ->
              loop(Socket, Transport, State, Loop - 1);
          E ->
              lager:error("[tcp:loop] Error: ~p~n", [E]),
              ok = Transport:close(Socket)
  
negative.code:             stream_loop(Socket, Transport, State, Dict, Acc1);
          {error, timeout} ->
              stream_loop(Socket, Transport, State, Dict, Acc);
          {error,closed} ->
              metric:mput(State#sstate.nodes, Dict, State#sstate.w),
              ok;
          E ->
              lager:error("[tcp:stream] Error: ~p~n", [E]),
              metric:mput(State#sstate.nodes, Dict, State#sstate.w),
              ok = Transport:close(Socket)
      end.
  
  