Cleaning up some naughty globals