anchor.diff:                  undefined -> 20;
                   BinNum -> list_to_integer(binary_to_list(BinNum))
               end,
  -        Num = ternary(Filters == [], Num0, -1),
  +        Num = ternary(Filters == [], Num0 - 1, -1),
   
           logplex_stats:incr(session_accessed),
   
  
positive.code:     inet:setopts(Socket, [{packet, raw}, {active, once}]),
      receive
          {log, Msg} ->
              io:format("recv'd tail msg ~p~n", [Msg]),
              Msg1 = logplex_utils:parse_msg(Msg),
              logplex_utils:filter(Msg1, Filters) andalso gen_tcp:send(Socket, logplex_utils:format(Msg1)),
              tail_loop(Socket, Filters);
  
negative.code:     Method = Req:get(method),
      Path = Req:get(path),
      io:format("REQ: ~p ~p~n", [Method, Path]),
      serve(handlers(), Method, Path, Req),
      ok.
  
  handlers() ->
      [{['GET', "/healthcheck"], fun(Req, _Match) ->
  	authorize(Req),
          Count = logplex_stats:healthcheck(),
          Req:respond({200, [], integer_to_list(Count)})
      end},
  
      {['POST', "/channels$"], fun(Req, _Match) ->
  	authorize(Req),
  	{struct, Params} = mochijson2:decode(Req:recv_body()),
          ChannelName = proplists:get_value(<<"name">>, Params),
          ChannelName == undefined andalso error_resp(Req, 400, <<"name post param missing">>),
  