Fix index generation and index entry in TOC