fix GetHighestIndex and GetLowestIndex