empty information object sets are OK
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index a6066a3..c51f998 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -2803,8 +2803,14 @@
         }
     }
     if(constraining_column < 0) {
-        FATAL("Can not find referenced object class column %s\n", cfield);
-        return -1;
+        if(opt_ioc->ioct->rows == 0) {
+            OUT("0");
+            return 0;
+        } else {
+            FATAL("Can not find referenced object class %s column %s\n",
+                  asn1p_ref_string(objset_ref), cfield);
+            return -1;
+        }
     }
 
     if(expr->meta_type != AMT_TYPEREF
diff --git a/libasn1fix/asn1fix_cws.c b/libasn1fix/asn1fix_cws.c
index c9b3af6..8965b96 100644
--- a/libasn1fix/asn1fix_cws.c
+++ b/libasn1fix/asn1fix_cws.c
@@ -1,6 +1,8 @@
 #include "asn1fix_internal.h"
 #include "asn1fix_cws.h"
 
+const char *asn1p_constraint_string(const asn1p_constraint_t *);
+
 static int _asn1f_parse_class_object_data(arg_t *, asn1p_expr_t *eclass,
 		struct asn1p_ioc_row_s *row, asn1p_wsyntx_t *syntax,
 		const uint8_t *buf, const uint8_t *bend,
@@ -82,26 +84,22 @@
  */
 static int
 _asn1f_add_unique_row(arg_t *arg, asn1p_expr_t *expr, asn1p_ioc_row_t *row) {
+    assert(expr->ioc_table);
 
-    if(expr->ioc_table == NULL) {
-        expr->ioc_table = asn1p_ioc_table_new();
-    } else {
-        /* Look for duplicates */
-
-        switch(_asn1f_is_ioc_row_duplicate(expr->ioc_table, row)) {
-        case -1:
-            DEBUG("Found Information Object Duplicate in %s", expr->Identifier,
-                  expr->_lineno);
-            return -1;
-        case 0:
-            /* Not a duplicate */
-            break;
-        case 1:
-            /* Proper duplicate detected; ignore */
-            asn1p_ioc_row_delete(row);
-            return 0;
+    /* Look for duplicates */
+    switch(_asn1f_is_ioc_row_duplicate(expr->ioc_table, row)) {
+    case -1:
+        DEBUG("Found Information Object Duplicate in %s", expr->Identifier,
+              expr->_lineno);
+        return -1;
+    case 0:
+        /* Not a duplicate */
+        break;
+    case 1:
+        /* Proper duplicate detected; ignore */
+        asn1p_ioc_row_delete(row);
+        return 0;
         }
-    }
 
     asn1p_ioc_table_add(expr->ioc_table, row);
 
@@ -180,27 +178,28 @@
 }
 
 static int
-_asn1f_foreach_unparsed(const asn1p_constraint_t *ct,
+_asn1f_foreach_unparsed(arg_t *arg, const asn1p_constraint_t *ct,
                         int (*process)(const uint8_t *buf, size_t size,
                                        void *key),
                         void *key) {
     if(!ct) return -1;
-    if(ct->type == ACT_CA_UNI) {
+
+    switch(ct->type) {
+    default:
+        DEBUG("Constraint %s is of unknown type for CWS",
+              asn1p_constraint_string(ct));
+        return -1;
+    case ACT_EL_EXT:    /* ... */
+        return 0;
+    case ACT_CA_UNI:    /* | */
         return _asn1f_foreach_unparsed_union(ct, process, key);
+    case ACT_CA_CSV:    /* , */
+        break;
     }
-    if(ct->type != ACT_CA_CSV) return -1;
 
     for(size_t i = 0; i < ct->el_count; i++) {
         const asn1p_constraint_t *ct1 = ct->elements[i];
-        switch(ct1->type) {
-        case ACT_EL_EXT:
-            break;
-        case ACT_CA_UNI:
-            if(_asn1f_foreach_unparsed_union(ct1, process, key) != 0) {
-                return -1;
-            }
-            break;
-        default:
+        if(_asn1f_foreach_unparsed(arg, ct1, process, key) != 0) {
             return -1;
         }
     }
@@ -209,8 +208,9 @@
 }
 
 static int
-_asn1f_constraint_looks_like_object_set(const asn1p_constraint_t *ct) {
-    return 0 == _asn1f_foreach_unparsed(ct, NULL, NULL);
+_asn1f_constraint_looks_like_object_set(arg_t *arg,
+                                        const asn1p_constraint_t *ct) {
+    return 0 == _asn1f_foreach_unparsed(arg, ct, NULL, NULL);
 }
 
 int
@@ -232,7 +232,7 @@
     } else if(expr->value && expr->value->type == ATV_UNPARSED) {
         source = FROM_VALUE;
     } else if(!expr->value) {
-        if(_asn1f_constraint_looks_like_object_set(expr->constraints)) {
+        if(_asn1f_constraint_looks_like_object_set(arg, expr->constraints)) {
             source = FROM_CONSTRAINT;
         } else {
             return 0;
@@ -267,6 +267,14 @@
         .sequence = 0
     };
 
+    if(!expr->ioc_table) {
+        expr->ioc_table = asn1p_ioc_table_new();
+    }
+
+    if(!eclass->ioc_table) {
+        eclass->ioc_table = asn1p_ioc_table_new();
+    }
+
     switch(source) {
     case FROM_VALUE:
         if(_asn1f_parse_object_cb(expr->value->value.string.buf + 1,
@@ -276,8 +284,8 @@
         }
         break;
     case FROM_CONSTRAINT:
-        if(_asn1f_foreach_unparsed(expr->constraints, _asn1f_parse_object_cb,
-                                   &key)
+        if(_asn1f_foreach_unparsed(arg, expr->constraints,
+                                   _asn1f_parse_object_cb, &key)
            != 0) {
             return -1;
         }
diff --git a/tests/tests-asn1c-compiler/145-empty-information-object-set-OK.asn1 b/tests/tests-asn1c-compiler/145-empty-information-object-set-OK.asn1
new file mode 100755
index 0000000..cd68676
--- /dev/null
+++ b/tests/tests-asn1c-compiler/145-empty-information-object-set-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .145
+
+ModuleEmptyInformationObjectSet
+	{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
+		spelio(9363) software(1) asn1c(5) test(1) 145 }
+	DEFINITIONS ::=
+BEGIN
+
+    Frame ::= SEQUENCE {
+        ident   TYPE-IDENTIFIER.&id({FrameTypes}),
+        value   TYPE-IDENTIFIER.&Type({FrameTypes}{@ident})
+    }
+
+    FrameTypes TYPE-IDENTIFIER ::= { ... }
+
+END