Fix scoping in tests.