Fix bug in Math.random().

Return value should be 0 <= x < 1. Fix typo and divide by RAND_MAX + 1.0
to avoid integer overflow.