anchor.diff:      {next_state, StateName, State};
   handle_event({watch_leader_status, Pid}, StateName, State = #state{watchers = Watchers}) ->
       _ = notify_leader_status(Pid, StateName, State),
  -    %% Might as well take this opportunity to prune any dead pids that are in the list
  -    NewWatcherList = [P || P <- [Pid | Watchers], is_process_alive(P)],
  -    {next_state, StateName, State#state{watchers = NewWatcherList}};
  +    MRef = erlang:monitor(process, Pid),
  +    {next_state, StateName, State#state{watchers = [{Pid, MRef} | Watchers]}};
   handle_event({stop_watching, Pid}, StateName, State = #state{watchers = Watchers}) ->
  -    NewWatcherList = lists:delete(Pid, Watchers),
  -    {next_state, StateName, State#state{watchers = NewWatcherList}};
  +    case remove_watcher(Pid, Watchers) of
  +        not_found ->
  +            lager:warning("Tried to stop watching for pid ~p, but did not find it in watcher list"),
  +            {next_state, StateName, State};
  +        {MRef, NewWatcherList} ->
  +            erlang:demonitor(MRef, [flush]),
  +            {next_state, StateName, State#state{watchers = NewWatcherList}}
  +    end;
   handle_event({reply, ReqId, Peer, Reply}, StateName, State) ->
       State2 = handle_reply(ReqId, Peer, Reply, State),
       {next_state, StateName, State2};
  
positive.code:             undefined
      end.
  
  notify_leader_status(PidList, StateName, State) when is_list(PidList) ->
      [notify_leader_status(P, StateName, State) || P <- PidList];
  notify_leader_status(Pid, leading, State = #state{id = Id, ensemble = Ensemble}) ->
      Pid ! {is_leading, self(), Id, Ensemble, epoch(State)};
  notify_leader_status(Pid, _, State = #state{id = Id, ensemble = Ensemble}) ->
  
negative.code:         {reset, ModState2} ->
              State2 = State#state{modstate=ModState2},
              step_down(State2)
      end.
  
  -spec terminate(_,_,_) -> ok.
  terminate(_Reason, _StateName, _State) ->
  