ToC works in the editor but not in the live template. Each link in the ToC gets a number added to the anchor link which doesn't match the actual ID of the header element.