anchor.diff:  		{undefined, _} ->
   			ok;
   		_ ->
  -			ranch:start_listener(
  +			Started = ranch:start_listener(
   				mqtt,
   				Acceptors,
   				ranch_tcp,
   				[{port, Port}, {max_connections, MaxConnections} | Options],
   				mqtt_protocol,
   				[{dispatch, mqtt_server}]
  -			)
  +			),
  +
  +			case Started of
  +				{error, _} ->
  +					ok;
  +				_ ->
  +					Started
  +			end
   	end.
   
   start_mqtts_listener(EnvPort, Settings) ->
  -	Port = application:get_env(?APPLICATION, EnvPort),
  +	{ok, Port} = application:get_env(?APPLICATION, EnvPort),
   
   	MaxConnections = Settings#?MODULE.max_connections,
   	Options = Settings#?MODULE.options,
  
positive.code: 				]}
  			]),
  
  			cowboy:start_http(
  				http,
  				Acceptors,
  				[{port, Port}, {max_connections, MaxConnections} | Options],
  				[{env, [{dispatch, Dispatch}]}]
  			)
  	end.
  
  %%
  
negative.code: 	case {Port, MaxConnections} of
  		{undefined, _} -> ok;
  		_ ->
  			Started = ranch:start_listener(
  				mqtts,
  				Acceptors,
  				ranch_ssl,
  				[{port, Port}, {max_connections, MaxConnections} | Options],
  				mqtt_protocol,
  				[{dispatch, mqtt_server}]
  			),
  
  			case Started of
  				{error, _} ->
  					ok;
  				_ ->
  					Started
  			end
  
  	end.
  
  start_websocket_listener(EnvPort, Settings) ->
  	{ok, Port} = application:get_env(?APPLICATION, EnvPort),
  
  	MaxConnections = Settings#?MODULE.max_connections,
  	Options = Settings#?MODULE.options,
  