Index: kernel/ideals.cc
===================================================================
--- kernel/ideals.cc	(revision a4771e1b7535535946d3bd424ce5c97bd0866119)
+++ kernel/ideals.cc	(revision f7d39bddf5a7034fe148956d21d0cbe5d13c0021)
@@ -25,6 +25,7 @@
 #include <coeffs/coeffs.h>
 #include <coeffs/numbers.h>
-
-#include <kernel/polys.h>
+// #include <coeffs/longrat.h>
+
+
 #include <polys/monomials/ring.h>
 #include <polys/matpol.h>
@@ -37,8 +38,8 @@
 #include <kernel/ideals.h>
 
+#include <kernel/polys.h>
+
 #include <kernel/GBEngine/kstd1.h>
 #include <kernel/GBEngine/syz.h>
-
-#include <coeffs/longrat.h>
 
 
Index: kernel/ideals.h
===================================================================
--- kernel/ideals.h	(revision a4771e1b7535535946d3bd424ce5c97bd0866119)
+++ kernel/ideals.h	(revision f7d39bddf5a7034fe148956d21d0cbe5d13c0021)
@@ -7,6 +7,10 @@
 * ABSTRACT - all basic methods to manipulate ideals
 */
+
+#include <polys/monomials/ring.h>
+#include <polys/monomials/p_polys.h>
 #include <polys/simpleideals.h>
-#include <kernel/polys.h>
+
+extern ring currRing;
 
 #include <kernel/structs.h> // for tHomog
@@ -54,13 +58,8 @@
 #define idSimpleAdd(A,B) id_SimpleAdd(A,B,currRing)
 
-#ifdef PDEBUG
-#define idTest(A) id_DBTest(A, PDEBUG, __FILE__,__LINE__,currRing)
-#define idPrint(id) idShow(id, currRing, currRing)
-#else
-#define idTest(A)  do {} while (0)
-#define idPrint(A) do {} while (0)
-#endif
-
 ideal id_Copy (ideal h1, const ring r);
+
+#define idPrint(id) id_Print(id, currRing, currRing)
+#define idTest(id)  id_Test(id, currRing)
 
 #if 0
Index: libpolys/polys/monomials/p_polys.cc
===================================================================
--- libpolys/polys/monomials/p_polys.cc	(revision a4771e1b7535535946d3bd424ce5c97bd0866119)
+++ libpolys/polys/monomials/p_polys.cc	(revision f7d39bddf5a7034fe148956d21d0cbe5d13c0021)
@@ -775,7 +775,5 @@
 {
   assume(p!=NULL);
-#ifdef PDEBUG
-  _p_Test(p,r,PDEBUG);
-#endif
+  p_Test(p,r);
   p_CheckPolyRing(p, r);
   long o;
@@ -802,7 +800,5 @@
       pp = p;
     }
-#ifdef PDEBUG
-    _p_Test(pp,r,PDEBUG);
-#endif
+    p_Test(pp,r);
     o = r->pFDeg(pp, r);
   }
@@ -1446,7 +1442,5 @@
     return NULL;
   }
-  #ifdef PDEBUG
-  _p_Test(p,r,PDEBUG);
-  #endif
+  p_Test(p,r);
   ok=!errorreported;
   return p;
@@ -2040,7 +2034,5 @@
     p_MonPower(p,exp,r);
     p_MonPower(tail,exp,r);
-#ifdef PDEBUG
     p_Test(p,r);
-#endif
     return p;
   }
@@ -2089,7 +2081,5 @@
 //     pIter(tail);
 // }
-#ifdef PDEBUG
   p_Test(res,r);
-#endif
   return res;
 }
Index: libpolys/polys/simpleideals.cc
===================================================================
--- libpolys/polys/simpleideals.cc	(revision a4771e1b7535535946d3bd424ce5c97bd0866119)
+++ libpolys/polys/simpleideals.cc	(revision f7d39bddf5a7034fe148956d21d0cbe5d13c0021)
@@ -417,5 +417,5 @@
 
 #ifdef PDEBUG
-void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r)
+void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r, const ring tailRing)
 {
   int i;
@@ -426,8 +426,10 @@
     omCheckAddrSize(h1,sizeof(*h1));
     omdebugAddrSize(h1->m,h1->ncols*h1->nrows*sizeof(poly));
+     
     /* to be able to test matrices: */
     for (i=(h1->ncols*h1->nrows)-1; i>=0; i--)
-      _p_Test(h1->m[i], r, level);
-    int new_rk=id_RankFreeModule(h1,r);
+      _pp_Test(h1->m[i], r, tailRing, level);
+     
+    int new_rk=id_RankFreeModule(h1, r, tailRing);
     if(new_rk > h1->rank)
     {
Index: libpolys/polys/simpleideals.h
===================================================================
--- libpolys/polys/simpleideals.h	(revision a4771e1b7535535946d3bd424ce5c97bd0866119)
+++ libpolys/polys/simpleideals.h	(revision f7d39bddf5a7034fe148956d21d0cbe5d13c0021)
@@ -63,10 +63,10 @@
 
 #ifdef PDEBUG
-void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r);
-#define id_Test(A, r) id_DBTest(A, PDEBUG, __FILE__,__LINE__, r)
-// #define id_Print(id, r) id_Show(id, r)
+void id_DBTest(ideal h1, int level, const char *f,const int l, const ring lR, const ring tR );
+#define id_TestTail(A, lR, tR) id_DBTest(A, PDEBUG, __FILE__,__LINE__, lR, tR)
+#define id_Test(A, lR) id_DBTest(A, PDEBUG, __FILE__,__LINE__, lR, lR)
 #else
-#define id_Test(A, r)  do {} while (0)
-// #define id_Print(A, r) do {} while (0)
+#define id_TestTail(A, lR, tR)  do {} while (0)
+#define id_Test(A, lR) do {} while (0)
 #endif
 
@@ -131,5 +131,9 @@
 #ifdef PDEBUG
 void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint = 0);
+#define id_Print(id, lR, tR) idShow(id, lR, tR)
+#else
+#define id_Print(A, lR, tR) do {} while (0)
 #endif
+
 
 
