Added uncaught exception catcher to make the CLI not to be killed.