Added fixup_html_message() to add missing HTML tags.  Misc code cleanup.  fixes #7785