Fix crash on exit via Application singleton