Improved TOC title and secnum parsing