Added checking for invalid input when parsing a single-line command.