Fix hosts handling