Handle unclosed section headers in ref files