Fix leaky test global state