Remove empty headings before nesting