Fixed optional header numbering
Fixed bug with inline math and linebreaks