Improvements to TOC formatting.

On Windows, I noticed that the TOC was causing problems, overlapping
the writing. This fixes that problem.