anchor.diff:          StatsRows = [[Idx, nop | tuple_to_list(lists:nth(Idx, StatsRowsZipped))] || Idx <- lists:seq(1, length(Avgs))],
           ?Debug("Stat Rows ~p", [StatsRows]),
           StatColumns = [<<"column">>, <<"count">>, <<"min">>, <<"max">>, <<"sum">>, <<"avg">>, <<"median">>, <<"std_dev">>, <<"variance">>,<<"hash">>],
  -        {reply, {lists:max(Counts), StatColumns, StatsRows, atom_to_binary(SN, utf8)}, SN, State, infinity}
  +        {next_state, SN, State, [{reply, From, {lists:max(Counts), StatColumns, StatsRows, atom_to_binary(SN, utf8)}}]}
       catch
           _:Error ->
  -            {reply, {error, iolist_to_binary(io_lib:format("~p", [Error])), erlang:get_stacktrace()}
  -                  , SN, State, infinity}
  +            {next_state, SN, State, [{reply, From, {error, iolist_to_binary(io_lib:format("~p", [Error])), erlang:get_stacktrace()}}]}
       end;
  -handle_sync_event({distinct_count, ColumnId}, _From, SN, #state{nav = Nav, tableId = TableId, indexId = IndexId, rowFun = RowFun, ctx=#ctx{stmtCols=StmtCols}} = State) ->
  +handle_call({distinct_count, ColumnId}, From, SN, #state{nav = Nav, tableId = TableId, indexId = IndexId, rowFun = RowFun, ctx=#ctx{stmtCols=StmtCols}} = State) ->
       case Nav of
           raw -> TableUsed = TableId;
           _ ->   TableUsed = IndexId
  
positive.code:     State4 = data_clear(State3),
      State5 = gui_clear(#gres{state=tailing,loop= <<"tail">>},State4),
      {next_state, tailing, State5#state{tailMode=true,tailLock=false}};
  aborted({button, <<"...">>, ReplyTo}, State0) ->
      % reject because of uncommitted changes
      State1 = gui_nop(#gres{state=aborted,beep=true,message= ?MustCommit},State0#state{replyToFun=ReplyTo}),
      {next_state, aborted, State1};
  aborted({button, <<">|...">>, ReplyTo}, State0) ->
      % keep data (if any) and switch .. tail mode
      State1 = reply_stack(aborted, ReplyTo, State0),
      State2 = fetch(skip,true,State1),
      State3 = gui_clear(State2),
      State4 = gui_nop(#gres{state=tailing,loop= <<"tail">>},State3),
      {next_state, tailing, State4#state{tailMode=true,tailLock=false}};
  aborted({button, <<">|">>, ReplyTo}, #state{bufCnt=0}=State0) ->
      % reject command because we have no data
      State1 = reply_stack(aborted, ReplyTo, State0),
      State1 = gui_nop(#gres{state=aborted,beep=true},State1),
      {next_state, aborted, State1};
  aborted({button, <<">|">>, ReplyTo}, #state{bl=BL,bufBot=BufBot}=State0) ->
      % jump .. buffer bottom
      State1 = reply_stack(aborted, ReplyTo, State0),
      State2 = gui_replace_until(BufBot,BL,#gres{state=aborted},State1),
      {next_state, aborted, State2};
  aborted({rows, _}, State) ->
      % ignore unsolicited rows
      {next_state, aborted, State};
  aborted(Other, State) ->
      ?Info("aborted -- unexpected event ~p", [Other]),
      {next_state, aborted, State}.
  
  passthrough({button, <<"restart">>, ReplyTo}, #state{dirtyCnt=DC}=State0) when DC==0 ->
      State1 = reply_stack(passthrough, ReplyTo, State0),
      State2 = fetch_close(State1),
      State3 = data_clear(State2),
      State4 = fetch(none,true,State3),
      State5 = gui_clear(#gres{state=filling,loop= <<">">>}, State4),
      {next_state, filling, State5#state{tailMode=false}};
  passthrough({button, <<"restart">>, ReplyTo}, State0) ->
      % reject command because of uncommitted changes
      State1 = gui_nop(#gres{state=passthrough,beep=true,message= ?MustCommit},State0#state{replyToFun=ReplyTo}),
      {next_state, passthrough, State1};
  passthrough({button, <<"...">>, ReplyTo}, State0) ->
      State1 = reply_stack(passthrough, ReplyTo, State0),
      State2 = gui_nop(#gres{state=passthrough,beep=true,message= ?PassThroughOnlyRestart},State1),
      {next_state, passthrough, State2};
  passthrough({button, <<">|...">>, ReplyTo}, State0) ->
      State1 = reply_stack(passthrough, ReplyTo, State0),
      State2 = gui_nop(#gres{state=passthrough,beep=true,message= ?PassThroughOnlyRestart},State1),
      {next_state, passthrough, State2};
  passthrough({button, <<">|">>, ReplyTo}, State0) ->
      State1 = reply_stack(passthrough, ReplyTo, State0),
      State2 = gui_nop(#gres{state=passthrough,beep=true,message= ?PassThroughOnlyRestart},State1),
      {next_state, passthrough, State2};
  passthrough({button, <<"pt">>, ReplyTo}, State0) ->
      % passthrough, schedule tail
      State1 = reply_stack(passthrough, ReplyTo, State0),
      {next_state, passthrough, State1#state{stack={button,<<"pt">>,ReplyTo}}};
  passthrough({button, <<"tail">>, ReplyTo}=Cmd, #state{tailLock=false,bufBot=BufBot,guiBot=GuiBot}=State0) when GuiBot==BufBot ->
      State1 = reply_stack(passthrough, ReplyTo, State0),
      {ok, NewTRef} = timer:send_after(?TAIL_TIMEOUT, cmd_stack_timeout),
      {next_state, passthrough, State1#state{stack=Cmd, tRef=NewTRef}};
  passthrough({button, <<"tail">>, ReplyTo}, #state{tailLock=false}=State0) ->
      % continue passthrough
      State1 = reply_stack(passthrough, ReplyTo, State0),
      State2 = serve_bot(passthrough, <<"tail">>, State1),
      {next_state, passthrough, State2};
  passthrough({button, <<"tail">>, ReplyTo}, State0) ->
      % ignore loop command, stop passthrough
      State1 = gui_nop(#gres{state=passthrough},State0#state{replyToFun=ReplyTo}),
      {next_state, passthrough, State1};
  passthrough({delete, {Recs,Complete}}, State0) ->
      State1 = data_append(passthrough,{Recs,Complete,del},State0),
      {next_state, passthrough, State1#state{pfc=0}};
  passthrough({rows, {Recs,Complete}}, State0) ->
      State1 = data_append(passthrough,{Recs,Complete},State0),
      {next_state, passthrough, State1#state{pfc=0}};
  passthrough(Other, State) ->
      ?Info("passthrough -- unexpected event ~p", [Other]),
      {next_state, passthrough, State}.
  
  
  %% --------------------------------------------------------------------
  
negative.code:     State4 = fetch(skip,true, State3),
      State5 = gui_clear(#gres{state=tailing, loop= <<"tail">>},State4),
      {next_state, tailing, State5#state{tailMode=true,tailLock=false}};
  autofilling(cast, {button, <<"...">>, ReplyTo}, State0) ->
      % reject because of uncommitted changes
      State1 = gui_nop(#gres{state=autofilling,beep=true,message= ?MustCommit},State0#state{replyToFun=ReplyTo}),
      {next_state, autofilling, State1};
  autofilling(cast, {button, <<">|...">>, ReplyTo}=Cmd, #state{tailMode=TailMode}=State0) ->
      if
          (TailMode == false) ->
              % too late .. change .. seamless tail mode now
  