anchor.diff:              gb_trees:insert(Host, NewNode, NewNodes)
           end, gb_trees:empty(), Config),
       lists:foreach(
  -        fun(OldNode) ->
  -            case gb_trees:lookup(OldNode#dnode.host, NewNodes) of
  -                none ->
  -                    unlink(OldNode#dnode.node_mon),
  -                    exit(OldNode#dnode.node_mon, kill);
  -                _ -> ok
  -            end
  -        end, gb_trees:values(S#state.nodes)),
  +      fun(#dnode{host = Host, node_mon = NodeMon}) ->
  +              case gb_trees:lookup(Host, NewNodes) of
  +                  none ->
  +                      unlink(NodeMon),
  +                      exit(NodeMon, kill);
  +                  _ -> ok
  +              end
  +      end, gb_trees:values(Nodes)),
       disco_proxy:update_nodes(gb_trees:keys(NewNodes)),
       update_nodes(NewNodes),
       S1 = do_gc_blacklist(GCBlacklist, S),
  
positive.code: 
  -spec do_get_num_cores(state()) -> {ok, cores()}.
  do_get_num_cores(#state{nodes = Nodes}) ->
      {ok, lists:sum([N#dnode.slots || N <- gb_trees:values(Nodes)])}.
  
  -spec do_kill_job(jobname()) -> ok.
  do_kill_job(JobName) ->
  
negative.code: -spec update_stats(host_name(), none | {value, dnode()}, _,
                     state()) -> state().
  update_stats(_Node, none, _ReplyType, S) -> S;
  update_stats(Node, {value, #dnode{num_running = NumRunning,
                                    stats_ok = StatsOk,
                                    stats_failed = StatsFailed,
                                    stats_crashed = StatsCrashed} = N},
               ReplyType, #state{nodes = Nodes} = S) ->
      M = N#dnode{num_running = NumRunning - 1},
      M0 = case ReplyType of
               done ->
                   M#dnode{stats_ok = StatsOk + 1};
               error ->
                   M#dnode{stats_failed = StatsFailed + 1};
               fatal ->
                   M#dnode{stats_crashed = StatsCrashed + 1};
               _ ->
                   M#dnode{stats_crashed = StatsCrashed + 1}
           end,
      S#state{nodes = gb_trees:update(Node, M0, Nodes)}.
  
  -spec do_connection_status(host_name(), up | down, state()) -> state().
  do_connection_status(Node, Status, #state{nodes = Nodes} = S) ->
  