Command and atype parser, minor cleanups