Made some conversions of randoma numbers generated from double to scalar explicit.