Fix exit crash

Static shared pointers are the worst idea ever.