Fixed precision issues in WeightedRandom