This is due to osclass no longer being a child of osmatch i.e. from a recent nmap xml output
<os><portused state="open" proto="tcp" portid="XXX" />
<osclass type="general purpose" vendor="OpenBSD" osfamily="OpenBSD" osgen="4.X" accuracy="85" />
<osmatch name="OpenBSD 4.3" accuracy="85" line="30610"/>
<osmatch name="OpenBSD 4.0" accuracy="85" line="30351"/>
</os>
osfamily = hostnode.getElementsByTagName("os")[0].getElementsByTagName("osclass")[0].getAttribute("family")
osvendor = hostnode.getElementsByTagName("os")[0].getElementsByTagName("osclass")[0].getAttribute("vendor")
ostype = hostnode.getElementsByTagName("os")[0].getElementsByTagName("osclass")[0].getAttribute("type")
To allow this to work; however I am unsure of the intent in the code at first glance is intended to append the multple match results or take the first osclass in each case? once clarified I'll create a fork (if needed) and submit a pull request.