Bugfix: ensure ns.r2 and ns.rm are defined