fix getMaxIndex for tie handling