Fixes global leak in tests.