Fix a possible panic in the weight randomization algorithm
Fix a possible panic in the weight randomization algorithm

etix/mirrorbits,etix/mirrorbits,Myself5/mirrorbits,kib/mirrorbits,kArTeL/mirrorbits,Myself5/mirrorbits,kArTeL/mirrorbits,wsnipex/mirrorbits,etix/mirrorbits,kib/mirrorbits,wsnipex/mirrorbits,kib/mirrorbits,wsnipex/mirrorbits,kArTeL/mirrorbits,Myself5/mirrorbits