Fixed hosname parsing