Fix when host or scheme are not always available