Index: Singular/ipid.h
===================================================================
--- Singular/ipid.h	(revision 49abe32113946584967f7bc6a8d3edfd9b6f848c)
+++ Singular/ipid.h	(revision 0e051f7f753a1b83c52767ff9ee1a7406bfd8da1)
@@ -18,4 +18,8 @@
 extern package basePack;
 #define IDROOT (currPack->idroot)
+
+struct sip_command;
+typedef struct sip_command ip_command;
+typedef ip_command *       command;
 
 struct sip_command
Index: Singular/ipshell.h
===================================================================
--- Singular/ipshell.h	(revision 49abe32113946584967f7bc6a8d3edfd9b6f848c)
+++ Singular/ipshell.h	(revision 0e051f7f753a1b83c52767ff9ee1a7406bfd8da1)
@@ -11,4 +11,7 @@
 #include "structs.h"
 #include "ideals.h"
+
+struct _ssubexpr;
+typedef struct _ssubexpr *Subexpr;
 
 
Index: Singular/silink.h
===================================================================
--- Singular/silink.h	(revision 49abe32113946584967f7bc6a8d3edfd9b6f848c)
+++ Singular/silink.h	(revision 0e051f7f753a1b83c52767ff9ee1a7406bfd8da1)
@@ -10,4 +10,5 @@
 
 #include "structs.h"
+#include "sing_dbm.h"
 
 // extension links:
Index: Singular/sing_dbm.h
===================================================================
--- Singular/sing_dbm.h	(revision 49abe32113946584967f7bc6a8d3edfd9b6f848c)
+++ Singular/sing_dbm.h	(revision 0e051f7f753a1b83c52767ff9ee1a7406bfd8da1)
@@ -9,5 +9,6 @@
 */
 
-#include "structs.h"
+struct s_si_link_extension;
+typedef struct s_si_link_extension *si_link_extension;
 
 si_link_extension slInitDBMExtension(si_link_extension s);
Index: Singular/subexpr.cc
===================================================================
--- Singular/subexpr.cc	(revision 49abe32113946584967f7bc6a8d3edfd9b6f848c)
+++ Singular/subexpr.cc	(revision 0e051f7f753a1b83c52767ff9ee1a7406bfd8da1)
@@ -39,6 +39,5 @@
 #include "subexpr.h"
 
-
-omBin sSubexpr_bin = omGetSpecBin(sizeof(sSubexpr));
+omBin sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr));
 omBin sleftv_bin = omGetSpecBin(sizeof(sleftv));
 omBin procinfo_bin = omGetSpecBin(sizeof(procinfo));
@@ -1255,4 +1254,5 @@
   }
 #endif
+  idhdl save_ring=currRingHdl;
   v->Init();
   if(packhdl != NULL)
@@ -1312,7 +1312,11 @@
       }
     }
+    if (yyInRingConstruction)
+    {
+      currRingHdl=NULL;
+    }
     /* 4. local ring: ringvar */
     if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
-    && (!yyInRingConstruction))
+    /*&& (!yyInRingConstruction)*/)
     {
       int vnr;
@@ -1338,5 +1342,6 @@
     {
       BOOLEAN ok=FALSE;
-      poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;
+      /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
+      poly p = pmInit(id,ok);
       if (ok)
       {
@@ -1352,6 +1357,5 @@
           #endif
         }
-        else
-        if (pIsConstant(p))
+        else if (pIsConstant(p))
         {
           v->data = pGetCoeff(p);
@@ -1375,5 +1379,5 @@
       poly p = ((currRing!=NULL)     /* ring required */
                && (currRingHdl!=NULL)
-               && (!yyInRingConstruction) /* not in decl */
+               /*&& (!yyInRingConstruction) - not in decl */
                && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
                      ? pmInit(id,ok) : (poly)NULL;
@@ -1446,4 +1450,5 @@
     v->name = id;
   }
+  currRingHdl=save_ring;
   return;
 id_found: // we have an id (in h) found, to set the data in from h
@@ -1453,4 +1458,5 @@
   v->name = IDID(h);
   v->attribute=IDATTR(h);
+  currRingHdl=save_ring;
 }
 
Index: Singular/subexpr.h
===================================================================
--- Singular/subexpr.h	(revision 49abe32113946584967f7bc6a8d3edfd9b6f848c)
+++ Singular/subexpr.h	(revision 0e051f7f753a1b83c52767ff9ee1a7406bfd8da1)
@@ -22,6 +22,5 @@
 };
 
-typedef struct _ssubexpr sSubexpr;
-typedef sSubexpr * Subexpr;
+typedef struct _ssubexpr *Subexpr;
 
 extern const char sNoName[];
@@ -90,12 +89,4 @@
 extern sleftv sLastPrinted;
 
-struct _sssym
-{
-  idhdl   h;
-  Subexpr e;
-};
-typedef struct _sssym ssym;
-typedef ssym * sym;
-
 void syMake(leftv v,const char * name, idhdl packhdl = NULL);
 BOOLEAN assumeStdFlag(leftv h);
