Added logging of all uncaught exceptions.