anchor.diff:      {reply, {ok, C}, StateName, S};
   handle_sync_event(nick, _From, StateName, S = #state{nick=N}) ->
       {reply, {ok, N}, StateName, S};
  -handle_sync_event(shutdown, _From, _StateName, S = #state{con=P}) when is_pid(P) ->
  -    unlink(P),
  -    irc_connection:close(P),
  -    {stop, shutdown, ok, S#state{con=undefined}};
   handle_sync_event(shutdown, _From, _StateName, S) ->
  -    {stop, shutdown, ok, S};
  +    {stop, normal, ok, S};
   handle_sync_event(Event, _From, StateName, State) ->
       ?WARN("Unexpected event ~p in state ~p", [Event, StateName]),
       {next_state, StateName, State}.
  
positive.code: %% necessary cleaning up. When it returns, the gen_fsm terminates with
  %% Reason. The return value is ignored.
  %%--------------------------------------------------------------------
  terminate(_Reason, _StateName, _State) ->
      ok.
  
  
negative.code: connecting(timeout, State = #state{conf=Conf}) ->
      {ok, Pid} = irc_connection:start_link(Conf#conf.host,
                                            Conf#conf.port,
                                            [{sendfn, fun irc_client_fsm_send/2}]),
      {next_state, wait_connected, State#state{con=Pid}}.
  
  wait_connected({irc, Pid, connected}, State = #state{conf=Conf}) ->
  