Fix issues with TOC, internal links and html-doctype.