Better reference endmatter detection
More endmatter detection (avoid duplicate detection procedures)