diff --git a/src/main/java/com/samskivert/util/Randoms.java b/src/main/java/com/samskivert/util/Randoms.java
index 22f2f649..7d394b9c 100644
--- a/src/main/java/com/samskivert/util/Randoms.java
+++ b/src/main/java/com/samskivert/util/Randoms.java
@@ -144,10 +144,10 @@ public class Randoms
/**
* Pick a random key from the specified mapping of weight values, or return
- * ifEmpty if no mapping has a weight greater than 0.
+ * ifEmpty if no mapping has a weight greater than 0.
*
*
Implementation note: a random number is generated for every entry with a - * non-zero weight. + * non-zero weight after the first such entry. * * @throws IllegalArgumentException if any weight is less than 0. */ @@ -159,7 +159,7 @@ public class Randoms double weight = entry.getValue().doubleValue(); if (weight > 0.0) { total += weight; - if ((_r.nextDouble() * total) < weight) { + if ((total == weight) || ((_r.nextDouble() * total) < weight)) { pick = entry.getKey(); } } else if (weight < 0.0) {