diff --git a/src/post_modules/Nettle/aead.H b/src/post_modules/Nettle/aead.H
index 9e78de2c56c8ea03327ad8e207956de98586da92..9747f129512831feb7a53ed0eda510a452022f2b 100644
--- a/src/post_modules/Nettle/aead.H
+++ b/src/post_modules/Nettle/aead.H
@@ -51,9 +51,11 @@ PIKECLASS PIKE_NAME
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
-		      parent_State_fun_num +
-		      parent_prog->inherits[1].identifier_level,
+		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
 	}
       }
diff --git a/src/post_modules/Nettle/aead.cmod b/src/post_modules/Nettle/aead.cmod
index a44c41f76f077249e8b3792f08a8f81f00007f94..c51ca4ecf60e1e3e0345bb4a2ac24e6fad0308dc 100644
--- a/src/post_modules/Nettle/aead.cmod
+++ b/src/post_modules/Nettle/aead.cmod
@@ -204,9 +204,11 @@ PIKECLASS AEAD
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
-		      parent_State_fun_num +
-		      parent_prog->inherits[1].identifier_level,
+		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
 	}
       }
diff --git a/src/post_modules/Nettle/cipher.H b/src/post_modules/Nettle/cipher.H
index 809cc8b60bc8bd52e6a08a79f18e19d7df1b4bae..117c5ac502e58bea08f0f94873c4fc9fb9050861 100644
--- a/src/post_modules/Nettle/cipher.H
+++ b/src/post_modules/Nettle/cipher.H
@@ -77,6 +77,9 @@ PIKECLASS PIKE_NAME
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0, parent_State_fun_num,
 		      1 + 42, 0, NULL);
 	}
diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod
index bdd92c2365f26d63ed4a678e0a8a59570d63e1ed..2f77000283262a23e7251ba5e06723a67a143a55 100644
--- a/src/post_modules/Nettle/cipher.cmod
+++ b/src/post_modules/Nettle/cipher.cmod
@@ -205,6 +205,9 @@ PIKECLASS Cipher
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
 		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
@@ -1119,6 +1122,9 @@ PIKECLASS BlockCipher
 	  struct program *parent_State_prog =
 	    low_program_from_function(parent_obj, parent_State_fun_num);
 	  if (parent_State_prog) {
+	    parent_State_fun_num =
+	      really_low_reference_inherited_identifier(Pike_compiler->previous,
+							0, parent_State_fun_num);
 	    low_inherit(parent_State_prog, 0,
 			parent_State_fun_num,
 			1 + 42, 0, NULL);
@@ -1625,6 +1631,9 @@ PIKECLASS BlockCipher
 	  struct program *parent_State_prog =
 	    low_program_from_function(parent_obj, parent_State_fun_num);
 	  if (parent_State_prog) {
+	    parent_State_fun_num =
+	      really_low_reference_inherited_identifier(Pike_compiler->previous,
+							0, parent_State_fun_num);
 	    low_inherit(parent_State_prog, 0,
 			parent_State_fun_num,
 			1 + 42, 0, NULL);
@@ -2140,6 +2149,9 @@ PIKECLASS BlockCipher
 	  struct program *parent_State_prog =
 	    low_program_from_function(parent_obj, parent_State_fun_num);
 	  if (parent_State_prog) {
+	    parent_State_fun_num =
+	      really_low_reference_inherited_identifier(Pike_compiler->previous,
+							0, parent_State_fun_num);
 	    low_inherit(parent_State_prog, 0,
 			parent_State_fun_num,
 			1 + 42, 0, NULL);
@@ -2532,6 +2544,9 @@ PIKECLASS BlockCipher
 	  struct program *parent_State_prog =
 	    low_program_from_function(parent_obj, parent_State_fun_num);
 	  if (parent_State_prog) {
+	    parent_State_fun_num =
+	      really_low_reference_inherited_identifier(Pike_compiler->previous,
+							0, parent_State_fun_num);
 	    low_inherit(parent_State_prog, 0,
 			parent_State_fun_num,
 			1 + 42, 0, NULL);
@@ -2980,6 +2995,9 @@ PIKECLASS BlockCipher16
 	struct program *parent__CTR_prog =
 	  low_program_from_function(parent_obj, parent__CTR_fun_num);
 	if (parent__CTR_prog) {
+	  parent__CTR_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent__CTR_fun_num);
 	  low_inherit(parent__CTR_prog, 0,
 		      parent__CTR_fun_num,
 		      1 + 42, 0, NULL);
@@ -3057,6 +3075,9 @@ PIKECLASS BlockCipher16
 	  struct program *parent_State_prog =
 	    low_program_from_function(parent_obj, parent_State_fun_num);
 	  if (parent_State_prog) {
+	    parent_State_fun_num =
+	      really_low_reference_inherited_identifier(Pike_compiler->previous,
+							0, parent_State_fun_num);
 	    low_inherit(parent_State_prog, 0,
 			parent_State_fun_num,
 			1 + 42, 0, NULL);
@@ -3492,8 +3513,9 @@ PIKECLASS BlockCipher16
      */
     EXTRA
     {
-      /* Perform an inherit if the _CCM class that our parent contains.
+      /* Perform an inherit of the _CCM class that our parent contains.
        */
+      /* FIXME: */
       low_inherit(Nettle_BlockCipher16_cq__CCM_program, 0,
 		  Nettle_BlockCipher16_cq__CCM_program_fun_num,
 		  1 + 42, 0, NULL);
@@ -3628,6 +3650,9 @@ PIKECLASS BlockCipher16
 	  struct program *parent_State_prog =
 	    low_program_from_function(parent_obj, parent_State_fun_num);
 	  if (parent_State_prog) {
+	    parent_State_fun_num =
+	      really_low_reference_inherited_identifier(Pike_compiler->previous,
+							0, parent_State_fun_num);
 	    low_inherit(parent_State_prog, 0,
 			parent_State_fun_num,
 			1 + 42, 0, NULL);
@@ -4081,6 +4106,9 @@ PIKECLASS BlockCipher16
 	  struct program *parent_State_prog =
 	    low_program_from_function(parent_obj, parent_State_fun_num);
 	  if (parent_State_prog) {
+	    parent_State_fun_num =
+	      really_low_reference_inherited_identifier(Pike_compiler->previous,
+							0, parent_State_fun_num);
 	    low_inherit(parent_State_prog, 0,
 			parent_State_fun_num,
 			1 + 42, 0, NULL);
@@ -4636,6 +4664,9 @@ PIKECLASS ARCTWO
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
 		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
@@ -5008,6 +5039,9 @@ PIKECLASS CHACHA
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
 		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
@@ -5218,6 +5252,9 @@ PIKECLASS DES
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
 		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
@@ -5455,6 +5492,9 @@ PIKECLASS DES3
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
 		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
@@ -5572,6 +5612,9 @@ PIKECLASS SALSA20
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
 		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
diff --git a/src/post_modules/Nettle/hash.H b/src/post_modules/Nettle/hash.H
index 53c605cc637074500595dc6cc692f18bea747cf3..21f0ea043cbfe5f040249dca2c8e8c22799dc217 100644
--- a/src/post_modules/Nettle/hash.H
+++ b/src/post_modules/Nettle/hash.H
@@ -51,9 +51,11 @@ PIKECLASS PIKE_NAME
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
-		      parent_State_fun_num +
-		      parent_prog->inherits[1].identifier_level,
+		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
 	}
       }
diff --git a/src/post_modules/Nettle/hash.cmod b/src/post_modules/Nettle/hash.cmod
index 403c09a888a5a2b7c19a6af3a415704d29585c80..1b0aa920ee9366ad02625ff3a4c3b8bea0fc77c0 100644
--- a/src/post_modules/Nettle/hash.cmod
+++ b/src/post_modules/Nettle/hash.cmod
@@ -472,9 +472,11 @@ PIKECLASS Hash
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
-		      parent_State_fun_num +
-		      parent_prog->inherits[1].identifier_level,
+		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
 	}
       }
diff --git a/src/post_modules/Nettle/mac.H b/src/post_modules/Nettle/mac.H
index d9179a47032df2ac815eb252550e0de45f754d22..1fc9b46b8b3db6a138cdfb9323e6b077b8155fb0 100644
--- a/src/post_modules/Nettle/mac.H
+++ b/src/post_modules/Nettle/mac.H
@@ -51,9 +51,11 @@ PIKECLASS PIKE_NAME
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
-		      parent_State_fun_num +
-		      parent_prog->inherits[1].identifier_level,
+		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
 	}
       }
diff --git a/src/post_modules/Nettle/mac.cmod b/src/post_modules/Nettle/mac.cmod
index 52faed91c4920048d9f1ff2c19b7857cdfc71d0a..b3ae84cc4a0a5d2a378dcd951aeb53bfdf6b83de 100644
--- a/src/post_modules/Nettle/mac.cmod
+++ b/src/post_modules/Nettle/mac.cmod
@@ -184,9 +184,11 @@ PIKECLASS MAC
 	struct program *parent_State_prog =
 	  low_program_from_function(parent_obj, parent_State_fun_num);
 	if (parent_State_prog) {
+	  parent_State_fun_num =
+	    really_low_reference_inherited_identifier(Pike_compiler->previous,
+						      0, parent_State_fun_num);
 	  low_inherit(parent_State_prog, 0,
-		      parent_State_fun_num +
-		      parent_prog->inherits[1].identifier_level,
+		      parent_State_fun_num,
 		      1 + 42, 0, NULL);
 	}
       }