Skip commands that have too few arguments

Partially fixes #2391 by validating that each command has the expected number of arguments and skipping commands that have too few arguments.