Updates to improve handling of host keys