fixed a small bug in your handling of MISC type

otherwise so far so good, I'll use it locally to generate the HTML.