html_render.py with a couple fixes