Fix off by one error when selecting entities to spawn.