Use internal code rather than reimplementing. Fix CmdArgs argument processing.