Catch bad lexical cast in main function.
Merge branch 'develop' into coverity-scan