Fix bug where randomItem() never return last array item