Fix hostkey extraction