Fix out-of-bounds crash in DomainIndex.