Make the HTML (mostly) valid