Fix guard so it can use local bindings in the test