Fixed command line error handling