Parses headings. Improved minor bug counting.