fixed several things in an attempt to generate valid HTML5