Replace StdRng with task_rng()