Added detecting the hostkey type rather than relying on RSA.