Change to local 'rng' instead of global 'rng'

Fixes #61