Fix a few variables leaking in the global state.