Corrects finding the maximum index when there are no other roles of that type. Resolves #212.