Markup cleanup and validation fixes