small code enhancements
fixes #45 wrong parsing of text before headlines