Fix ArrayOutOfBoundsException in getSpawn