Index: kernel/GBEngine/kstd1.cc
===================================================================
--- kernel/GBEngine/kstd1.cc	(revision 045cbe4a6ae2c0b09895eb1b2407beeb5c723e7e)
+++ kernel/GBEngine/kstd1.cc	(revision f8fb93d1bc922d1e97207d1d5b347fe1db1eedcf)
@@ -12,6 +12,4 @@
 #define MORA_USE_BUCKETS
 
-#define MYTEST 0
-
 #define ADIDEBUG 0
 #define ADIDEBUG_NF 0
@@ -23,10 +21,4 @@
 #include <misc/options.h>
 #include <misc/intvec.h>
-
-#if MYTEST
-#ifdef HAVE_TAIL_RING
-#undef HAVE_TAIL_RING
-#endif /* ifdef HAVE_TAIL_RING */
-#endif /* if MYTEST */
 
 #include <polys/weight.h>
@@ -1616,5 +1608,4 @@
   kTest_TS(strat);
   strat->use_buckets = kMoraUseBucket(strat);
-  /*- compute-------------------------------------------*/
 
 #ifdef HAVE_TAIL_RING
@@ -1629,4 +1620,5 @@
   }
 
+  /*- compute-------------------------------------------*/
   while (strat->Ll >= 0)
   {
@@ -1836,11 +1828,13 @@
       if (strat->P.lcm!=NULL)
       {
-#if defined(HAVE_RINGS)
-        pLmDelete(strat->P.lcm);
+#ifdef HAVE_RINGS
+        if (rField_is_Ring(currRing)) pLmDelete(strat->P.lcm);
+        else
 #else
-        pLmFree(strat->P.lcm);
+          pLmFree(strat->P.lcm);
 #endif
         strat->P.lcm=NULL;
       }
+
 #ifdef KDEBUG
       // make sure kTest_TS does not complain about strat->P
@@ -1866,16 +1860,4 @@
     }
     kTest_TS(strat);
-
-#if ADIDEBUG
-    Print("\n    The new reducer list T -- at the end of loop %d -- is\n",loop_count);
-    for(int iii=0;iii<=strat->tl;iii++)
-    {
-      printf("\n    T[%d]:",iii);
-      p_Write(strat->T[iii].p,strat->tailRing);
-    }
-    PrintLn();
-
-    loop_count++;
-#endif /* ADIDEBUG */
   }
   /*- complete reduction of the standard basis------------------------ -*/
@@ -2293,13 +2275,4 @@
   idTest(F);
   if (Q!=NULL) idTest(Q);
-
-#if MYTEST
-  if (TEST_OPT_DEBUG)
-  {
-    PrintS("// kSTD: currRing: ");
-    rWrite(currRing);
-  }
-#endif
-
 #endif
 #ifdef HAVE_PLURAL
@@ -2504,13 +2477,4 @@
   idTest(F);
   idTest(Q);
-
-#if MYTEST
-  if (TEST_OPT_DEBUG)
-  {
-    PrintS("// kSTD: currRing: ");
-    rWrite(currRing);
-  }
-#endif
-
 #endif
 #ifdef HAVE_PLURAL
Index: kernel/GBEngine/kstd2.cc
===================================================================
--- kernel/GBEngine/kstd2.cc	(revision 045cbe4a6ae2c0b09895eb1b2407beeb5c723e7e)
+++ kernel/GBEngine/kstd2.cc	(revision f8fb93d1bc922d1e97207d1d5b347fe1db1eedcf)
@@ -14,18 +14,6 @@
 #include <kernel/mod2.h>
 
-#ifndef SING_NDEBUG
-# define MYTEST 0
-#else /* ifndef SING_NDEBUG */
-# define MYTEST 0
-#endif /* ifndef SING_NDEBUG */
-
 #define ADIDEBUG 0
 #define ADIDEBUG_COUNT 0
-
-#if MYTEST
-# ifdef HAVE_TAIL_RING
-#  undef HAVE_TAIL_RING
-# endif // ifdef HAVE_TAIL_RING
-#endif
 
 // define if no buckets should be used
@@ -448,13 +436,6 @@
       }
     }
-    #if ADIDEBUG
-    pWrite(h->p);
-    printf("\nFound j = %i\n",j);pWrite(strat->T[j].p);
-    #endif
     //enterT(*h, strat);
     ksReducePoly(h, &(strat->T[j]), NULL, NULL, strat); // with debug output
-    #if ADIDEBUG
-    printf("\nand after reduce: \n");pWrite(h->p);
-    #endif
 
     if (h->GetLmTailRing() == NULL)
@@ -1494,16 +1475,4 @@
   kTest_TS(strat);
 
-#ifdef KDEBUG
-#if MYTEST
-  if (TEST_OPT_DEBUG)
-  {
-    PrintS("bba start GB: currRing: ");
-    // rWrite(currRing);PrintLn();
-    rDebugPrint(currRing);
-    PrintLn();
-  }
-#endif /* MYTEST */
-#endif /* KDEBUG */
-
 #ifdef HAVE_TAIL_RING
   if(!idIs0(F) &&(!rField_is_Ring(currRing)))  // create strong gcd poly computes with tailring and S[i] ->to be fixed
@@ -1524,42 +1493,4 @@
   while (strat->Ll >= 0)
   {
-    #if ADIDEBUG
-    printf("\n      ------------------------NEW LOOP\n");
-    printf("\nShdl = \n");
-    #if 0
-    idPrint(strat->Shdl);
-    #else
-    for(int ii = 0; ii<=strat->sl;ii++)
-        p_Write(strat->S[ii],strat->tailRing);
-    #endif
-    printf("\n   list   L\n");
-    int iii;
-    #if 1
-    for(iii = 0; iii<= strat->Ll; iii++)
-    {
-        printf("L[%i]:",iii);
-        p_Write(strat->L[iii].p, currRing);
-        p_Write(strat->L[iii].p1, currRing);
-        p_Write(strat->L[iii].p2, currRing);
-    }
-    #else
-    {
-        printf("L[%i]:",strat->Ll);
-        p_Write(strat->L[strat->Ll].p, strat->tailRing);
-        p_Write(strat->L[strat->Ll].p1, strat->tailRing);
-        p_Write(strat->L[strat->Ll].p2, strat->tailRing);
-    }
-    #endif
-    #if 1
-    for(iii = 0; iii<= strat->Bl; iii++)
-    {
-        printf("B[%i]:",iii);
-        p_Write(strat->B[iii].p, /*strat->tailRing*/currRing);
-        p_Write(strat->B[iii].p1, /*strat->tailRing*/currRing);
-        p_Write(strat->B[iii].p2, strat->tailRing);
-    }
-    #endif
-    getchar();
-    #endif
     #ifdef KDEBUG
       if (TEST_OPT_DEBUG) messageSets(strat);
@@ -1636,11 +1567,5 @@
 
       /* reduction of the element chosen from L */
-      #if ADIDEBUG
-      printf("\nBefore \n");pWrite(strat->P.p);
-      #endif
       red_result = strat->red(&strat->P,strat);
-      #if ADIDEBUG
-      printf("\nAfter \n");pWrite(strat->P.p);
-      #endif
       if (errorreported)  break;
     }
@@ -1666,10 +1591,4 @@
       int pos=posInS(strat,strat->sl,strat->P.p,strat->P.ecart);
 
-#ifdef KDEBUG
-#if MYTEST
-      PrintS("New S: "); p_DebugPrint(strat->P.p, currRing); PrintLn();
-#endif /* MYTEST */
-#endif /* KDEBUG */
-
       // reduce the tail and normalize poly
       // in the ring case we cannot expect LC(f) = 1,
@@ -1693,7 +1612,4 @@
 #ifdef KDEBUG
       if (TEST_OPT_DEBUG){PrintS("new s:");strat->P.wrp();PrintLn();}
-#if MYTEST
-      PrintS("New (reduced) S: "); p_DebugPrint(strat->P.p, currRing); PrintLn();
-#endif /* MYTEST */
 #endif /* KDEBUG */
 
@@ -1730,8 +1646,4 @@
           enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl);
         // posInS only depends on the leading term
-        #if ADIDEBUG
-        printf("\nThis element is added to S\n");
-        p_Write(strat->P.p, strat->tailRing);p_Write(strat->P.p1, strat->tailRing);p_Write(strat->P.p2, strat->tailRing);
-        #endif
         strat->enterS(strat->P, pos, strat, strat->tl);
 #if 0
@@ -1767,19 +1679,17 @@
         }
       }
-      #if ADIDEBUG
-      for(int iii = 0; iii<=strat->tl;iii++)
-      {
-        printf("\nT[%i] = ",iii);pWrite(strat->T[iii].p);
-      }
-      #endif
 
       if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
 //      Print("[%d]",hilbeledeg);
       if (strat->P.lcm!=NULL)
+      {
 #ifdef HAVE_RINGS
-        pLmDelete(strat->P.lcm);
+        if (rField_is_Ring(currRing)) pLmDelete(strat->P.lcm);
+        else
 #else
-        pLmFree(strat->P.lcm);
-#endif
+          pLmFree(strat->P.lcm);
+#endif
+        strat->P.lcm=NULL;
+      }
     }
     else if (strat->P.p1 == NULL && strat->minim > 0)
@@ -1794,7 +1704,4 @@
   }
 #ifdef KDEBUG
-#if MYTEST
-  PrintS("bba finish GB: currRing: "); rWrite(currRing);
-#endif /* MYTEST */
   if (TEST_OPT_DEBUG) messageSets(strat);
 #endif /* KDEBUG */
@@ -1868,9 +1775,4 @@
   if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
 
-#ifdef KDEBUG
-#if MYTEST
-  PrintS("bba_end: currRing: "); rWrite(currRing);
-#endif /* MYTEST */
-#endif /* KDEBUG */
   idTest(strat->Shdl);
 
@@ -1966,16 +1868,4 @@
   kTest_TS(strat);
 
-#ifdef KDEBUG
-#if MYTEST
-  if (TEST_OPT_DEBUG)
-  {
-    PrintS("bba start GB: currRing: ");
-    // rWrite(currRing);PrintLn();
-    rDebugPrint(currRing);
-    PrintLn();
-  }
-#endif /* MYTEST */
-#endif /* KDEBUG */
-
 #ifdef HAVE_TAIL_RING
   if(!idIs0(F) &&(!rField_is_Ring(currRing)))  // create strong gcd poly computes with tailring and S[i] ->to be fixed
@@ -2171,10 +2061,4 @@
       int pos = strat->sl+1;
 
-#ifdef KDEBUG
-#if MYTEST
-      PrintS("New S: "); pDebugPrint(strat->P.p); PrintLn();
-#endif /* MYTEST */
-#endif /* KDEBUG */
-
       // reduce the tail and normalize poly
       // in the ring case we cannot expect LC(f) = 1,
@@ -2221,8 +2105,4 @@
 #ifdef KDEBUG
       if (TEST_OPT_DEBUG){PrintS("new s:");strat->P.wrp();PrintLn();}
-#if MYTEST
-//#if 1
-      PrintS("New (reduced) S: "); pDebugPrint(strat->P.p); PrintLn();
-#endif /* MYTEST */
 #endif /* KDEBUG */
 
@@ -2453,7 +2333,4 @@
   }
 #ifdef KDEBUG
-#if MYTEST
-  PrintS("bba finish GB: currRing: "); rWrite(currRing);
-#endif /* MYTEST */
   if (TEST_OPT_DEBUG) messageSets(strat);
 #endif /* KDEBUG */
@@ -2517,9 +2394,4 @@
   if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
 
-#ifdef KDEBUG
-#if MYTEST
-  PrintS("bba_end: currRing: "); rWrite(currRing);
-#endif /* MYTEST */
-#endif /* KDEBUG */
 #if SBA_PRINT_SIZE_G
   size_g_non_red  = IDELEMS(strat->Shdl);
@@ -2906,10 +2778,4 @@
       int pos=posInS(strat,strat->sl,strat->P.p,strat->P.ecart);
 
-#ifdef KDEBUG
-#if MYTEST
-      PrintS("New S: "); pDebugPrint(strat->P.p); PrintLn();
-#endif /* MYTEST */
-#endif /* KDEBUG */
-
       // reduce the tail and normalize poly
       // in the ring case we cannot expect LC(f) = 1,
@@ -2935,8 +2801,4 @@
 #ifdef KDEBUG
       if (TEST_OPT_DEBUG){PrintS("new s:");strat->P.wrp();PrintLn();}
-#if MYTEST
-//#if 1
-      PrintS("New (reduced) S: "); pDebugPrint(strat->P.p); PrintLn();
-#endif /* MYTEST */
 #endif /* KDEBUG */
 
