anchor.diff:  		    %% No Header Body separator yet, read more data
   		    do_recv(SoFar, State);
   		true ->
  -		    Rest = header_received(SoFar, State),
  -		    %% XXX don't try to do length() on Rest if it is not a list!
  -		    logger:log(debug, "TCP receiver: My buffer now contains ~p bytes of data", [length(Rest)]),
  -		    Rest
  +		    case header_received(SoFar, State) of
  +			Rest when is_list(Rest) ->
  +			    logger:log(debug, "TCP receiver: My buffer now contains ~p bytes of data", [length(Rest)]),
  +			    Rest;
  +			Rest2 ->
  +			    Rest2
  +		    end
   	    end;
   	{error, closed} ->
   	    logger:log(debug, "TCP receiver: Extra debug: ~p recv() returned 'closed' in do_recv() (Socket: ~p)",
  
positive.code: recv_loop(State, DataIn) when record(State, state), list(DataIn), State#state.socketmodule == ssl ->
      Socket = State#state.socket,
      Rest = receive
  
  	       {ssl, Socket, B} ->
  		   L = binary_to_list(B),
  		   logger:log(debug, "TCP receiver: Received ~p bytes of data (SSL), adding it to my buffer which contained ~p bytes of data",
  
negative.code: 			   %% No Header Body separator yet, read more data
  			   SoFar;
  		       true ->
  			   case header_received(SoFar, State) of
  			       AdditionalData when is_list(AdditionalData) ->
  				   logger:log(debug, "TCP receiver: My buffer now contains ~p bytes of data (SSL)", [length(AdditionalData)]),
  				   AdditionalData;
  			       AdditionalData2 ->
  				   AdditionalData2
  			   end
  		   end;
  
  	       {ssl_closed, Socket} ->
  