Index: trunk.structs/src/prolang.y
===================================================================
--- trunk.structs/src/prolang.y	(Revision 2314)
+++ trunk.structs/src/prolang.y	(Arbeitskopie)
@@ -6085,7 +6085,6 @@
           {
               /* Identifier -> no such struct encountered yet */
               yyerrorf("Unknown base struct '%s'", get_txt($2->name));
-              free_shared_identifier($2);
           }
           else
           {
@@ -6155,8 +6154,6 @@
           
           assign_full_to_vartype(&type, actual_type);
           add_struct_member($3->name, type, NULL);
-          if ($3->type == I_TYPE_UNKNOWN)
-              free_shared_identifier($3);
             
           $$ = $1;
       }
@@ -6169,8 +6166,6 @@
           
           assign_full_to_vartype(&type, actual_type);
           add_struct_member($4->name, type, NULL);
-          if ($4->type == I_TYPE_UNKNOWN)
-              free_shared_identifier($4);
             
           $$ = $1;
       }
@@ -6533,10 +6528,6 @@
                       , get_txt(last_identifier->name));
               $$[0] = $$[1] = 0;
           }
-
-          /* Free the identifier again if this statement generated it */
-          if (last_identifier->type == I_TYPE_UNKNOWN)
-                free_shared_identifier(last_identifier);
       }
 ; /* inheritance_qualifier */
 
@@ -6690,8 +6681,6 @@
 
           /* Extract the string from the ident structure */
           p = ref_mstring($1->name);
-          if ($1->type == I_TYPE_UNKNOWN)
-              free_shared_identifier($1);
           $$ = p;
       }
 
@@ -12283,11 +12272,6 @@
                                            , $4, (bytecode_p)__PREPARE_INSERT__p
                                            );
 
-                      if ($1.real->type == I_TYPE_UNKNOWN)
-                      {
-                          free_shared_identifier($1.real);
-                      }
-
                       if (ix < 0)
                       {
                           switch(ix) {
@@ -13143,8 +13127,6 @@
       L_IDENTIFIER
       {
           $$ = ystring_copy(get_txt($1->name));
-          if ($1->type == I_TYPE_UNKNOWN)
-              free_shared_identifier($1);
       }
 
     | L_STRING L_STRING
@@ -15954,13 +15936,8 @@
         if (!id)
             fatal("Out of memory: identifier '%s'.\n", get_txt(STR_CALL_OTHER));
 
-        if (id->type == I_TYPE_UNKNOWN)
+        if (id->type != I_TYPE_UNKNOWN)
         {
-            /* No such identifier, therefor no such sefun */
-            free_shared_identifier(id);
-        }
-        else
-        {
             /* This shouldn't be necessary, but just in case... */
             while (id && id->type > I_TYPE_GLOBAL)
                 id = id->inferior;
@@ -16350,6 +16327,8 @@
     }
 
     all_globals = NULL;
+    
+    remove_unknown_identifier();
 
     /* Now create the program structure */
     switch (0) { default:
Index: trunk.structs/src/lex.c
===================================================================
--- trunk.structs/src/lex.c	(Revision 2312)
+++ trunk.structs/src/lex.c	(Arbeitskopie)
@@ -7793,7 +7793,7 @@
             count_ident_refs(id);
             for (id2 = id->inferior; id2 != NULL; id2 = id2->next)
             {
-                count_ident_refs(id);
+                count_ident_refs(id2);
             }
         }
     }
