Make sure to use matches in the order they are given when calling do_command() multiple times.
diff --git a/include/iptables.h b/include/iptables.h
index 205984e..a0dda60 100644
--- a/include/iptables.h
+++ b/include/iptables.h
@@ -4,6 +4,13 @@
 #include "iptables_common.h"
 #include "libiptc/libiptc.h"
 
+struct iptables_rule_match
+{
+	struct iptables_rule_match *next;
+
+	struct iptables_match *match;
+};
+
 /* Include file for additions: new matches and targets. */
 struct iptables_match
 {
@@ -50,7 +57,6 @@
 	unsigned int option_offset;
 	struct ipt_entry_match *m;
 	unsigned int mflags;
-	unsigned int used;
 #ifdef NO_SHARED_LIBS
 	unsigned int loaded; /* simulate loading so options are merged properly */
 #endif
@@ -134,7 +140,7 @@
 };
 
 extern struct iptables_target *find_target(const char *name, enum ipt_tryload);
-extern struct iptables_match *find_match(const char *name, enum ipt_tryload);
+extern struct iptables_match *find_match(const char *name, enum ipt_tryload, struct iptables_rule_match **match);
 
 extern int delete_chain(const ipt_chainlabel chain, int verbose,
 			iptc_handle_t *handle);