Fix nesting issues and reformat html

Fix missing close tags and reformat html to improve legibility