anchor.diff:  do_stop(Status,State) ->
       send_user_msg({stop, Status}, State),
       stop_os_cmd(State),
  -    {stop, normal, State#state{user_pid=undefined}}.
  -
  -
  -%% @private
  -stop_os_cmd(#state{port=Port, os_pid=OsPid, stop_time=Time}) ->
  +    {stop, normal, State#state{user_pid=undefined, os_pid=undefined}}.
  +
  +
  +%% @private
  +stop_os_cmd(#state{cmd=Cmd, port=Port, os_pid=OsPid, kill_time=KillTime}) ->
       Port ! {self(), close},
  -    timer:sleep(Time),
  -    case is_integer(OsPid) of
  +    case is_integer(KillTime) of
           true ->
  +            timer:sleep(KillTime),
  +            lager:debug("nklib_exec ~s sending kill", [Cmd]),
               os:cmd("kill -9 " ++ integer_to_list(OsPid));
           false ->
               ok
  
positive.code:     timeout_ref :: reference(),
      refresh_fun :: function(),
      parser :: function(),
      stop_time :: integer(),
      buffer = <<>> :: binary()
  }).
  
  
negative.code: -spec wait_sync(pid(), integer()) ->
      {ok, binary()} | {error, {Reason::term(), binary()}}.
  
  wait_sync(Pid, Timeout) ->
      wait_sync(Pid, Timeout, <<>>).
      
  
  %% @private
  -spec wait_sync(pid(), integer(), binary()) ->
      {ok, integer(), binary()} | {error, term()}.
  
  wait_sync(Pid, Timeout, Buff) ->
      receive 
          {?MODULE, Pid, Msg} ->
              case Msg of
                  {start, _} ->
                      wait_sync(Pid, Timeout, Buff);
                  {data, Data} ->
                      Data1 = <<Buff/binary, Data/binary>>,
                      wait_sync(Pid, Timeout, Data1);
                  {stop, ok} ->
                      {ok, Buff};
                  {stop, Reason} ->
  