Added error checking when reading the argument to a command.