More defensive parsing of commands.