Fixing some issues where the incorrect host would be returned.