Newer attempt with further escapes of headings, cleanup