Fix nested lists and headings