Changed WeightedRandom to use ObjectFloatMap and fixed errors