Improve error handling of command-line args processing.