--atomic-commit copies counters
diff --git a/ebtables.c b/ebtables.c
index e5d1035..7d41e1c 100644
--- a/ebtables.c
+++ b/ebtables.c
@@ -2108,7 +2108,13 @@
 			strcpy(replace.filename, optarg);
 			// get the information from the file
 			get_table(&replace);
-			replace.num_counters = 0;
+                        if (replace.nentries) {
+                                counterchanges = (unsigned short *)
+                                   malloc(sizeof(unsigned short) * (replace.nentries + 1));
+				for (i = 0; i < replace.nentries; i++)
+                                        counterchanges[i] = CNT_NORM;
+                                counterchanges[i] = CNT_END;
+                        }
 			free(replace.filename);
 			replace.filename = NULL;
 			break;