Updated handling of virtual hosts