Fix a bug in the parser with headings