fix bugs; make html sane again