anchor.diff:      after 0 ->
               TickSize = 7 + rand:uniform(56),
               TickData = binary:copy(<<0>>, TickSize),
  -            case
  -                encrypt_and_send_chunk(Params, Seq, [?TICK_CHUNK, TickData])
  -            of
  -                {Params_1, Seq_1, ok} ->
  +            {Params_1, Seq_1, Result} =
  +                encrypt_and_send_chunk(Params, Seq, [?TICK_CHUNK, TickData]),
  +            if
  +                Result =:= ok ->
                       output_handler(Params_1, Seq_1);
  -                {_, _, Error} ->
  -                    death_row({send_tick, trace(Error)})
  +                true ->
  +                    death_row({send_tick, trace(Result)})
               end
       end.
   
   output_handler_rekey(Params, Seq) ->
       case encrypt_and_send_rekey_chunk(Params, Seq) of
           #params{} = Params_1 ->
  -            Params_1;
  +            output_handler(Params_1, 0);
           SendError ->
               death_row({send_rekey, trace(SendError)})
       end.
   
  -output_handler_send(Params, Seq, {_Front, 0, _Rear}) ->
  -    {Params, Seq};
  -output_handler_send(Params, Seq, {Front, _Size, Rear}) ->
  -    Cleartext = Front ++ lists:reverse(Rear),
  -    case
  -        encrypt_and_send_chunk(Params, Seq, [?DATA_CHUNK, Cleartext])
  -    of
  -        {Params_1, Seq_1, ok} ->
  -            {Params_1, Seq_1};
  -        {_, _, Error} ->
  -            death_row({send_chunk, trace(Error)})
  +
  +
  +output_handler_xfer(Params, Seq) ->
  +    output_handler_xfer(Params, Seq, [], 0, []).
  +%%
  +output_handler_xfer(Params, Seq, {Front, Size, Rear}) ->
  +    output_handler_xfer(Params, Seq, Front, Size, Rear).
  +%%
  +output_handler_xfer(Params, Seq, Front, Size, Rear)
  +  when ?CHUNK_SIZE =< Size ->
  +    {Data, Q} = deq_iovec(?CHUNK_SIZE, Front, Size, Rear),
  +    {Params_1, Seq_1, Result} =
  +        encrypt_and_send_chunk(Params, Seq, [?DATA_CHUNK, Data]),
  +    if
  +        Result =:= ok ->
  +            output_handler_xfer(Params_1, Seq_1, Q);
  +        true ->
  +            death_row({send_chunk, trace(Result)})
  +    end;
  +output_handler_xfer(Params, Seq, Front, Size, Rear) ->
  +    case erlang:dist_ctrl_get_data(Params#params.dist_handle) of
  +        none ->
  +            if
  +                Size =:= 0 ->
  +                    {Params, Seq};
  +                true ->
  +                    Data = Front ++ lists:reverse(Rear),
  +                    {Params_1, Seq_1, Result} =
  +                        encrypt_and_send_chunk(
  +                          Params, Seq, [?DATA_CHUNK, Data]),
  +                    if
  +                        Result =:= ok ->
  +                            {Params_1, Seq_1};
  +                        true ->
  +                            death_row({send_chunk, trace(Result)})
  +                    end
  +            end;
  +        Bin when is_binary(Bin) ->
  +            Len = byte_size(Bin),
  +            output_handler_xfer(
  +              Params, Seq, Front,
  +              Size + 4 + Len, [Bin, <<Len:32>>|Rear]);
  +        [Bin1, Bin2] ->
  +            Len = byte_size(Bin1) + byte_size(Bin2),
  +            output_handler_xfer(
  +              Params, Seq, Front,
  +              Size + 4 + Len, [Bin2, Bin1, <<Len:32>>|Rear]);
  +        Iovec ->
  +            Len = iolist_size(Iovec),
  +            output_handler_xfer(
  +              Params, Seq, Front,
  +              Size + 4 + Len, lists:reverse(Iovec, [<<Len:32>>|Rear]))
       end.
   
   %% -------------------------------------------------------------------------
  
positive.code: 
  %% -------------------------------------------------------------------------
  %% erlang:dist_ctrl_* helpers
  
  %% Get data for sending from the VM and place it in a queue
  %%
  get_data(DistHandle, {Front, Size, Rear}) ->
      get_data(DistHandle, Front, Size, Rear).
  %%
  get_data(_DistHandle, Front, Size, Rear) when ?CHUNK_SIZE =< Size ->
      {Front, Size, Rear};
  get_data(DistHandle, Front, Size, Rear) ->
      case erlang:dist_ctrl_get_data(DistHandle) of
          none ->
              {Front, Size, Rear};
          Bin when is_binary(Bin)  ->
              Len = byte_size(Bin),
              get_data(
                DistHandle, Front, Size + 4 + Len,
                [Bin, <<Len:32>>|Rear]);
          [Bin1, Bin2] ->
              Len = byte_size(Bin1) + byte_size(Bin2),
              get_data(
                DistHandle, Front, Size + 4 + Len,
                [Bin2, Bin1, <<Len:32>>|Rear]);
          Iovec ->
              Len = iolist_size(Iovec),
              get_data(
                DistHandle, Front, Size + 4 + Len,
                lists:reverse(Iovec, [<<Len:32>>|Rear]))
      end.
  
  %% De-packet and deliver received data to the VM from a queue
  %%
  
negative.code: %%
  %% The game here is to flush all dist_data and dist_tick messages,
  %% prioritize dist_data over dist_tick, and to not use selective receive
  %% because that would hurt performance during overload
  
  output_handler(Params, Seq) ->
      receive
  