When "validate" checks index inconsistencies, it asserts that keys are in increasing order. It should also perform checks to detect duplicate keys on unique indexes.
Additionally, all KeyStrings are in the format (Key, RecordID). If there are two KeyStrings with duplicate Keys, each will have unique RecordID, and therefore never compare equally. This should be a consideration in the implementation.