Fix the abort when exiting the application.