Added command line checking for non-whitespace characters after the expected input of a command.