Fix for #13: Malformed HTML is getting mangled instead of fixed.

Thanks to @sascha-tasche for reporting it. And to @mattfarina
for digging up what we should really do to fix it.