anchor.diff:  	F = fun({Topic, QoS}, Subscriptions) ->
   				lists:keystore(Topic, 1, Subscriptions, {Topic, QoS})
   		end,
  -	NewState = State#?MODULE{subscriptions=lists:foldl(F, State#?MODULE.subscriptions, lists:zip(Topics, QoSs))},
  -	case State#?MODULE.alert of
  -		true -> {noreply, NewState, hibernate};
  -		false -> {noreply, NewState}
  -	end;
  +	noreply(State#?MODULE{subscriptions=lists:foldl(F, State#?MODULE.subscriptions, lists:zip(Topics, QoSs))});
   handle_info(#mqtt_unsubscribe{message_id=MessageId, dup=true}, State) ->
   	% Unsubscribe is performed synchronously.
   	% Just drop duplicate requests.
   	fubar_log:log(debug, ?MODULE, [State#?MODULE.name, "dropping duplicate", MessageId]),
  -	case State#?MODULE.alert of
  -		true -> {noreply, State, hibernate};
  -		false -> {noreply, State}
  -	end;
  +	noreply(State);
   handle_info(Info=#mqtt_unsubscribe{message_id=MessageId, topics=Topics},
   			State=#?MODULE{name=ClientId, transaction_timeout=Timeout, trace=Trace}) ->
   	do_transaction(ClientId, Info, Timeout, Trace),
  
positive.code: 	link(Client),
  	% Now flush buffer.
  	lists:foreach(fun(Fubar) -> gen_server:cast(self(), Fubar) end, lists:reverse(Buffer)),
  	NewState = State#?MODULE{client=Client, will=Will, buffer=[]},
  	case State#?MODULE.alert of
  		true -> {reply, ok, NewState, hibernate};
  		false -> {reply, ok, NewState}
  	end;
  handle_call({trace, Value}, _, State) ->
  	NewState = State#?MODULE{trace=Value},
  	case State#?MODULE.alert of
  		true -> {reply, ok, NewState, hibernate};
  		false -> {reply, ok, NewState}
  	end;
  handle_call(clean, _, State) ->
  	NewState = State#?MODULE{clean=true},
  	case State#?MODULE.alert of
  		true -> {reply, ok, NewState, hibernate};
  		false -> {reply, ok, NewState}
  	end;
  
  %% Fallback
  handle_call(Request, From, State) ->
  	fubar_log:log(noise, ?MODULE, [State#?MODULE.name, "unknown call", Request, From]),
  	case State#?MODULE.alert of
  		true -> {reply, ok, State, hibernate};
  		false -> {reply, ok, State}
  	end.
  
  %% Message delivery logic to the client.
  handle_cast(Fubar=#fubar{}, State=#?MODULE{name=ClientId, client=undefined, buffer=Buffer, buffer_limit=N}) ->
  	% Got a message to deliver to the client.
  	% But it's offline now, keep the message in buffer for later delivery.
  	fubar_log:trace(ClientId, Fubar),
  	NewState = State#?MODULE{buffer=lists:sublist([Fubar | Buffer], N)},
  	case State#?MODULE.alert of
  		true -> {noreply, NewState, hibernate};
  		false -> {noreply, NewState}
  	end;
  handle_cast(Fubar=#fubar{}, State=#?MODULE{name=ClientId, client=Client}) ->
  	% Got a message and the client is alive.
  	% Let's send it to the client.
  
negative.code: 				undefined -> ok;
  				_ -> State#?MODULE.client ! Complete
  			end,
  			noreply(State#?MODULE{transactions=Rest});
  		false ->
  			fubar_log:log(noise, ?MODULE, [ClientId, "unknown exit detected", Worker]),
  			noreply(State)
  	end;
  handle_info({'EXIT', Worker, Reason}, State=#?MODULE{name=ClientId}) ->
  	% Likely to be a transaction failure signal.
  	case lists:keytake(Worker, 2, State#?MODULE.transactions) of
  		{value, {MessageId, Worker, _}, Rest} ->
  			fubar_log:log(warning, ?MODULE, [ClientId, "transaction failure", MessageId, Reason]),
  			noreply(State#?MODULE{transactions=Rest});
  		false ->
  			fubar_log:log(warning, ?MODULE, [ClientId, "unknown exit detected", Worker, Reason]),
  			noreply(State)
  	end;
  
  %% Fallback
  handle_info(Info, State) ->
  	fubar_log:log(noise, ?MODULE, [State#?MODULE.name, "unknown info", Info]),
  	noreply(State).
  
  terminate(Reason, State=#?MODULE{name=ClientId, transaction_timeout=Timeout, trace=Trace}) ->
  	fubar_log:log(resource, ?MODULE, [ClientId, terminate, Reason]),
  