Fix bug where similar sections would merge erroneously