Fix bad ref in safe_walk, should fix tests