Fixes global leak in test