Correctly calculate random index in shuffle