Fixes to the HTML output routines