Fixed bug in rng.m