anchor.diff:      PortName = {spawn_executable, os:find_executable(Cmd, Dir)},
       try
           Port = erlang:open_port(PortName, PortSettings),
  -        {os_pid, OsPid} = erlang:port_info(Port, os_pid),
  -        ?debug("External mining process started with OS pid ~p", [OsPid]),
  -        {ok, Port, OsPid}
  +        case erlang:port_info(Port, os_pid) of
  +            {os_pid, OsPid} ->
  +                ?debug("External mining process started with OS pid ~p", [OsPid]),
  +                {ok, Port, OsPid};
  +            undefined ->
  +                ?warning("External mining process finished before ~p could acquire the OS pid", [?MODULE]),
  +                {ok, Port, undefined}
  +        end
       catch
           C:E ->
               {error, {port_error, {C, E}}}
       end.
   
  --spec exec_kill(integer()) -> ok.
  +-spec exec_kill(os_pid()) -> ok.
  +exec_kill(undefined) ->
  +    ok;
   exec_kill(OsPid) ->
       case is_unix() of
           true ->
  
positive.code: find_node(X, [{X1, Y}, {X, Y} | Nodes], Acc) ->
      {X, X1, Nodes ++ Acc};
  find_node(X, [{X, _Y} | _], _Acc) ->
    {error, ?POW_DEAD_END};
  find_node(X, [N1, N2 | Nodes], Acc) ->
    find_node(X, Nodes, [N1, N2 | Acc]).
  
  %%------------------------------------------------------------------------------
  %% @doc
  
negative.code: node_size(EdgeBits) when is_integer(EdgeBits), EdgeBits > 31 -> 8;
  node_size(EdgeBits) when is_integer(EdgeBits), EdgeBits >  0 -> 4.
  
  -spec exec_run(string(), string(), list(string())) ->
      {ok, Port :: port(), OsPid :: os_pid()} |
      {error, {port_error, {term(), term()}}}.
  exec_run(Cmd, Dir, Args) ->
      PortSettings = [
                      binary,
  