Catch standard exceptions in the main function.
Merge branch 'develop' into coverity-scan