Fixed bug with player's index overflow.