Does wrapping main content in a section muck around with the heading levels?
You can check visually using the HTML 5 outliner tool.