Moved invocations of rng('default'); other minor cleanup