Better error handling in parser_register_cmd()