Clean up some global state