Fix hostname detection.