Fixed the uncaught exception handler.