Clean up a leaking global and some typos