Properly close tags around headers