Fix headings check in content analysis
Some code style changes