anchor.diff:    {Pid, Ref, Tag}.
   
   cmd_sync(Cmd, Args, Cd, Envs, From) ->
  -  P = open_port({spawn_executable, os:find_executable(Cmd)}, [
  -    binary, stderr_to_stdout, use_stdio, exit_status, stream, eof, {args, Args}, {env, Envs}, {cd, Cd}
  -    ]),
  +  StdOpts = [binary, stderr_to_stdout, use_stdio, exit_status, stream, eof, {args, Args}, {env, Envs}],
  +  Opts = case Cd of
  +    undefined -> StdOpts;
  +    _ -> [{cd, Cd}|StdOpts]
  +  end,
  +  P = open_port({spawn_executable, os:find_executable(Cmd)},Opts),
     cmd_receive(P, [], From, undefined).
   
   cmd_receive(Port, Acc, From, Fun) ->
  
positive.code: 
  % Get information about the Beefile  
  info(Name) when is_list(Name) ->
    case ets:fetch(Name, ?BEEHIVE_BEE_OBJECT_INFO_TABLE) of
      [{Name, Dict}|_Rest] -> dict:to_list(Dict);
      _ ->
        case catch find_bee_file(Name) of
          {error, not_found} -> {error, not_found};
          _ -> {error, unknown_error}
        end
    end.
  
  
negative.code:     _ ->
        timer:sleep(100),
        read_pid_file_or_retry(PidFilename, Retries - 1)
    end.
  
  % Ets fun
  ets_process_restarter() ->
    process_flag(trap_exit, true),
    Pid = spawn_link(?MODULE, start_ets_process, []),
    register(?BEEHIVE_BEE_OBJECT_INFO_TABLE_PROCESS, Pid),
    receive
      {'EXIT', Pid, normal} -> % not a crash
        ok;
      {'EXIT', Pid, shutdown} -> % manual termination, not a crash
        ok;
      {'EXIT', Pid, _} ->
        ets_process_restarter();
      _Else ->
        ets_process_restarter()
    end.
  
  start_ets_process() ->
    TableOpts = [set, named_table, public],
    case catch ets:info(?BEEHIVE_BEE_OBJECT_INFO_TABLE) of
      undefined -> ets:new(?BEEHIVE_BEE_OBJECT_INFO_TABLE, TableOpts);
      _ -> ok
    end,
    receive
      kill -> ok;
      _ -> start_ets_process()
    end.