Fixed getLocationIndex()