Improve error handling in CLI client slightly.