Index: kernel/GBEngine/kspoly.cc
===================================================================
--- kernel/GBEngine/kspoly.cc	(revision 5f544e3856e15c729d9cd4aeb0a80d2c613f4be2)
+++ kernel/GBEngine/kspoly.cc	(revision b94a72a3900cee27c0409f0d8cfe58d9e880654c)
@@ -312,4 +312,5 @@
 }
 
+#ifdef HAVE_RINGS
 int ksReducePolyGCD(LObject* PR,
                  TObject* PW,
@@ -399,13 +400,15 @@
     ct = n_ExtGcd(pGetCoeff(p1), pGetCoeff(p2), &an, &bn, tailRing->cf);    // Calculate GCD
 #ifdef HAVE_SHIFTBBA
-    if (n_IsZero(an, tailRing->cf) || n_IsZero(bn, tailRing->cf))
-    {
-      // NOTE: not sure why this is not checked in the commutative case, this *does* happen and then zero coeff errors are reported
-
-      // NOTE: we are probably leaking memory of lm=pOne(), but we cannot delete it since it could also be lm=p1
-      n_Delete(&an, tailRing->cf);
-      n_Delete(&bn, tailRing->cf);
-      n_Delete(&ct, tailRing->cf);
-      return ret;
+    if(rIsLPRing(tailRing)) /* with this test: error at New/stdZtests.tst, infinite : Long/primdecint.tst */
+    {
+      if (n_IsZero(an, tailRing->cf) || n_IsZero(bn, tailRing->cf))
+      {
+        // NOTE: not sure why this is not checked in the commutative case, this *does* happen and then zero coeff errors are reported
+        // NOTE: we are probably leaking memory of lm=pOne(), but we cannot delete it since it could also be lm=p1
+        n_Delete(&an, tailRing->cf);
+        n_Delete(&bn, tailRing->cf);
+        n_Delete(&ct, tailRing->cf);
+        return ret;
+      }
     }
 #endif
@@ -437,4 +440,5 @@
   return ret;
 }
+#endif
 
 /* Computes a reduction of the lead coefficient only. We have already tested
@@ -1413,5 +1417,6 @@
 #ifdef HAVE_SHIFTBBA
   int shift1, shift2;
-  if (tailRing->isLPring) {
+  if (tailRing->isLPring)
+  {
     // assume: LM is shifted, tail unshifted
     assume(p_FirstVblock(a1, tailRing) <= 1);
Index: kernel/GBEngine/kstd2.cc
===================================================================
--- kernel/GBEngine/kstd2.cc	(revision 5f544e3856e15c729d9cd4aeb0a80d2c613f4be2)
+++ kernel/GBEngine/kstd2.cc	(revision b94a72a3900cee27c0409f0d8cfe58d9e880654c)
@@ -105,6 +105,7 @@
       {
         gcd = n_Gcd(pGetCoeff(p), pGetCoeff(T[j].p), r->cf);
-        if (o == -1 ||
-            n_Greater(n_EucNorm(ogcd, r->cf), n_EucNorm(gcd, r->cf), r->cf) == TRUE) {
+        if (o == -1
+        || n_Greater(n_EucNorm(ogcd, r->cf), n_EucNorm(gcd, r->cf), r->cf))
+        {
           ogcd = gcd;
           o = j;
@@ -125,6 +126,7 @@
       {
         gcd = n_Gcd(pGetCoeff(p), pGetCoeff(T[j].p), r->cf);
-        if (o == -1 ||
-            n_Greater(n_EucNorm(ogcd, r->cf), n_EucNorm(gcd, r->cf), r->cf) == TRUE) {
+        if (o == -1
+        || n_Greater(n_EucNorm(ogcd, r->cf), n_EucNorm(gcd, r->cf), r->cf))
+        {
           ogcd = gcd;
           o = j;
@@ -157,5 +159,6 @@
         {
             mult= n_QuotRem(pGetCoeff(p), pGetCoeff(T0p), &rest, r->cf);
-            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+            {
                 return 0;
             }
@@ -165,5 +168,6 @@
         {
             mult = n_QuotRem(pGetCoeff(p), pGetCoeff(T0p), &rest, r->cf);
-            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+            {
                 return 0;
             }
@@ -182,5 +186,6 @@
         {
             mult = n_QuotRem(pGetCoeff(p), pGetCoeff(T0p), &rest, r->cf);
-            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+            {
                 return 0;
             }
@@ -190,5 +195,6 @@
         {
             mult = n_QuotRem(pGetCoeff(p), pGetCoeff(T0p), &rest, r->cf);
-            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+            if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+            {
                 return 0;
             }
@@ -223,5 +229,6 @@
       {
         mult= n_QuotRem(pGetCoeff(p), pGetCoeff(T[j].p), &rest, r->cf);
-        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+        {
           o = j;
           orest = rest;
@@ -232,5 +239,6 @@
       {
         mult = n_QuotRem(pGetCoeff(p), pGetCoeff(T[j].p), &rest, r->cf);
-        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+        {
           o = j;
           orest = rest;
@@ -254,5 +262,6 @@
       {
         mult = n_QuotRem(pGetCoeff(p), pGetCoeff(T[j].t_p), &rest, r->cf);
-        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+        {
           o = j;
           orest = rest;
@@ -263,5 +272,6 @@
       {
         mult = n_QuotRem(pGetCoeff(p), pGetCoeff(T[j].t_p), &rest, r->cf);
-        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf) == TRUE) {
+        if (!n_IsZero(mult, r) && n_Greater(n_EucNorm(orest, r->cf), n_EucNorm(rest, r->cf), r->cf))
+        {
           o = j;
           orest = rest;
@@ -648,8 +658,10 @@
     /* check if a reducer of the lead term exists */
     j = kFindDivisibleByInT(strat, h);
-    if (j < 0) {
+    if (j < 0)
+    {
       /* check if a reducer with the same lead monomial exists */
       j = kFindSameLMInT_Z(strat, h);
-      if (j < 0) {
+      if (j < 0)
+      {
         /* check if a reducer of the lead monomial exists, by the above
          * check this is a real divisor of the lead monomial */
@@ -683,6 +695,6 @@
           }
         }
-	else
-	{
+        else
+        {
           /* not(lc(reducer) | lc(poly)) && not(lc(poly) | lc(reducer))
            * => we try to cut down the lead coefficient at least */
@@ -713,5 +725,6 @@
         ksReducePolyZ(h, &(strat->T[j]), NULL, NULL, strat);
         ksReducePolyGCD(&h2, &(strat->T[j]), NULL, NULL, strat);
-        if (!rHasLocalOrMixedOrdering(currRing)) {
+        if (!rHasLocalOrMixedOrdering(currRing))
+        {
           redtailBbaAlsoLC_Z(&h2, j, strat);
           h2.pCleardenom();
@@ -4350,6 +4363,4 @@
 /* shiftgb stuff */
 #ifdef HAVE_SHIFTBBA
-
-
 ideal bbaShift(ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat)
 {
@@ -4508,8 +4519,9 @@
       // therefore we call pCleardenom instead of pNorm
       strat->redTailChange=FALSE;
-      
+
       /* if we are computing over Z we always want to try and cut down
        * the coefficients in the tail terms */
-      if (rField_is_Z(currRing) && !rHasLocalOrMixedOrdering(currRing)) {
+      if (rField_is_Z(currRing) && !rHasLocalOrMixedOrdering(currRing))
+      {
         redtailBbaAlsoLC_Z(&(strat->P), strat->tl, strat);
         strat->P.pCleardenom();
@@ -4630,5 +4642,6 @@
           if (pLmShortDivisibleBy(strat->T[j].p, strat->sevT[j], strat->S[k], ~strat->sevS[k]))
           {
-            if (pLmCmp(strat->T[j].p, strat->S[k]) != 0) { // check whether LM is different
+            if (pLmCmp(strat->T[j].p, strat->S[k]) != 0)
+            { // check whether LM is different
               deleteInS(k, strat);
               --k;
@@ -4710,4 +4723,5 @@
   return (strat->Shdl);
 }
+#endif
 
 #ifdef HAVE_SHIFTBBA
@@ -4727,4 +4741,5 @@
 * element in t with respect to the given pDivisibleBy
 */
+#ifdef HAVE_SHIFTBBA
 int redFirstShift (LObject* h,kStrategy strat)
 {
Index: kernel/GBEngine/kutil.cc
===================================================================
--- kernel/GBEngine/kutil.cc	(revision 5f544e3856e15c729d9cd4aeb0a80d2c613f4be2)
+++ kernel/GBEngine/kutil.cc	(revision b94a72a3900cee27c0409f0d8cfe58d9e880654c)
@@ -234,5 +234,6 @@
 
 #ifdef HAVE_SHIFTBBA
-static inline int pLPDivComp(poly p, poly q) {
+static inline int pLPDivComp(poly p, poly q)
+{
   if ((currRing->pCompIndex < 0) || (__p_GetComp(p,currRing) == __p_GetComp(q,currRing)))
   {
@@ -755,5 +756,7 @@
   return -1;
 }
-
+#endif
+
+#ifdef HAVE_SHIFTBBA
 int kFindInTShift(poly p, kStrategy strat)
 {
@@ -1600,14 +1603,17 @@
   k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing);
 
-  if (!rHasLocalOrMixedOrdering(currRing)) {
+  if (!rHasLocalOrMixedOrdering(currRing))
+  {
     unsigned long sev = pGetShortExpVector(gcd);
 
-    for (int j = 0; j < strat->sl; j++) {
+    for (int j = 0; j < strat->sl; j++)
+    {
       if (j == i)
         continue;
 
-      if (n_DivBy(d, pGetCoeff(strat->S[j]), currRing->cf) &&
-          !(strat->sevS[j] & ~sev) &&
-          p_LmDivisibleBy(strat->S[j], gcd, currRing)) {
+      if (n_DivBy(d, pGetCoeff(strat->S[j]), currRing->cf)
+      && !(strat->sevS[j] & ~sev)
+      && p_LmDivisibleBy(strat->S[j], gcd, currRing))
+      {
         nDelete(&d);
         nDelete(&s);
@@ -3230,4 +3236,5 @@
   strat->Bl = -1;
 }
+
 /*2
 *the pairset B of pairs of type (s[i],p) is complete now. It will be updated
@@ -7287,5 +7294,6 @@
     return FALSE;
   int found = -1;
-  for (int i=strat->Bl; i>-1; i--) {
+  for (int i=strat->Bl; i>-1; i--)
+  {
     if (pLmEqual(strat->B[i].sig,sig))
     {
@@ -7823,9 +7831,13 @@
       int j;
       j = kFindDivisibleByInT(strat, &Ln);
-      if (j < 0) {
+      if (j < 0)
+      {
         j = kFindDivisibleByInT_Z(strat, &Ln);
-        if (j < 0) {
+        if (j < 0)
+	{
           break;
-        } else {
+        }
+	else
+	{
           /* reduction not cancelling a tail term, but reducing its coefficient */
           With = &(strat->T[j]);
@@ -12325,8 +12337,8 @@
 // }
 
-#ifdef HAVE_SHIFTBBA
 /*2
 * put the  lcm(q,p)  into the set B, q is the shift of some s[i]
 */
+#ifdef HAVE_SHIFTBBA
 static BOOLEAN enterOneStrongPolyShift (poly q, poly p, int /*ecart*/, int /*isFromQ*/, kStrategy strat, int atR, int /*ecartq*/, int qisFromQ, int shiftcount, int ifromS)
 {
@@ -12492,8 +12504,11 @@
   return TRUE;
 }
+#endif
+
 
 /*2
 * put the pair (q,p)  into the set B, ecart=ecart(p), q is the shift of some s[i] (ring case)
 */
+#ifdef HAVE_SHIFTBBA
 static void enterOnePairRingShift (poly q, poly p, int /*ecart*/, int isFromQ, kStrategy strat, int atR, int /*ecartq*/, int qisFromQ, int shiftcount, int ifromS)
 {
@@ -12736,5 +12751,7 @@
   kTest_TS(strat);
 }
-
+#endif
+
+#ifdef HAVE_SHIFTBBA
 // adds the strong pair and the normal pair for rings (aka gpoly and spoly)
 static void enterOneStrongPolyAndEnterOnePairRingShift(poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
@@ -12743,5 +12760,7 @@
   enterOnePairRingShift(q, p, ecart, isFromQ, strat, atR, ecartq, qisFromQ, shiftcount, ifromS); // "spoly"
 }
-
+#endif
+
+#ifdef HAVE_SHIFTBBA
 // creates if possible (q,p), (shifts(q),p)
 static void enterOnePairWithShifts (int q_inS /*also i*/, poly q, poly p, int ecartp, int p_isFromQ, kStrategy strat, int atR, int p_lastVblock, int q_lastVblock)
@@ -12831,5 +12850,4 @@
 #endif
 
-#ifdef HAVE_SHIFTBBA
 
 #ifdef KDEBUG
@@ -12840,4 +12858,5 @@
 * put the pair (q,p)  into the set B, ecart=ecart(p), q is the shift of some s[i]
 */
+#ifdef HAVE_SHIFTBBA
 void enterOnePairShift (poly q, poly p, int ecart, int isFromQ, kStrategy strat, int atR, int ecartq, int qisFromQ, int shiftcount, int ifromS)
 {
@@ -12950,5 +12969,6 @@
             pLmFree(Lp.lcm);
 #ifdef CRITERION_DEBUG
-            if (TEST_OPT_DEBUG) {
+            if (TEST_OPT_DEBUG)
+	    {
               Print("--- chain crit using B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
             }
@@ -12963,5 +12983,6 @@
         {
 #ifdef CRITERION_DEBUG
-          if (TEST_OPT_DEBUG) {
+          if (TEST_OPT_DEBUG)
+	  {
             Print("--- chain crit using pair to remove B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
           }
@@ -13027,5 +13048,6 @@
             pLmFree(Lp.lcm);
 #ifdef CRITERION_DEBUG
-            if (TEST_OPT_DEBUG) {
+            if (TEST_OPT_DEBUG)
+	    {
               Print("--- chain crit using B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
             }
@@ -13039,5 +13061,6 @@
         {
 #ifdef CRITERION_DEBUG
-          if (TEST_OPT_DEBUG) {
+          if (TEST_OPT_DEBUG)
+	  {
             Print("--- chain crit using pair to remove B[%d].lcm=%s\n", j, pString(strat->B[j].lcm));
           }
@@ -13169,4 +13192,5 @@
   }
 }
+#endif
 
 /*3
@@ -13175,4 +13199,5 @@
 * additionally we put the pairs (h, s \sdot h) for s>=1 to L
 */
+#ifdef HAVE_SHIFTBBA
 void initenterpairsShift (poly h,int k,int ecart,int isFromQ, kStrategy strat, int atR)
 {
@@ -13237,5 +13262,6 @@
       {
         // pairs (shifts(s[1..k]),h), (s[1..k],h)
-        for (j=0; j<=k; j++) {
+        for (j=0; j<=k; j++)
+	{
           if (!strat->fromQ[j])
           {
@@ -13281,5 +13307,6 @@
         new_pair=TRUE;
         // pairs (shifts(s[1..k]),h), (s[1..k],h)
-        for (j=0; j<=k; j++) {
+        for (j=0; j<=k; j++)
+	{
           poly s = strat->S[j];
           enterOnePairWithShifts(j, s, h, ecart, isFromQ, strat, atR, h_lastVblock, pmLastVblock(s));
@@ -13355,5 +13382,6 @@
       {
         // pairs (shifts(s[1..k]),h), (s[1..k],h)
-        for (j=0; j<=k; j++) {
+        for (j=0; j<=k; j++)
+	{
           if ((pGetComp(h)==pGetComp(strat->S[j]))
               || (pGetComp(strat->S[j])==0))
@@ -13417,4 +13445,5 @@
   }
 }
+#endif
 
 /*3
@@ -13423,4 +13452,5 @@
 * additionally we put the pairs (h, s \sdot h) for s>=1 to L
 */
+#ifdef HAVE_SHIFTBBA
 void initenterstrongPairsShift (poly h,int k,int ecart,int isFromQ, kStrategy strat, int atR)
 {
@@ -13485,5 +13515,6 @@
       {
         // pairs (shifts(s[1..k]),h), (s[1..k],h)
-        for (j=0; j<=k; j++) {
+        for (j=0; j<=k; j++)
+	{
           if (!strat->fromQ[j])
           {
@@ -13514,5 +13545,6 @@
         new_pair=TRUE;
         // pairs (shifts(s[1..k]),h), (s[1..k],h)
-        for (j=0; j<=k; j++) {
+        for (j=0; j<=k; j++)
+	{
           poly s = strat->S[j];
           // TODO: cache lastVblock of s[1..k] for later use
@@ -13560,5 +13592,6 @@
       {
         // pairs (shifts(s[1..k]),h), (s[1..k],h)
-        for (j=0; j<=k; j++) {
+        for (j=0; j<=k; j++)
+	{
           if ((pGetComp(h)==pGetComp(strat->S[j]))
               || (pGetComp(strat->S[j])==0))
@@ -13593,4 +13626,5 @@
   }
 }
+#endif
 
 /*2
@@ -13598,4 +13632,5 @@
 *superfluous elements in S will be deleted
 */
+#ifdef HAVE_SHIFTBBA
 void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR)
 {
@@ -13621,4 +13656,5 @@
   }
 }
+#endif
 
 /*2
@@ -13626,4 +13662,5 @@
 * assumes that p is already in T!
 */
+#ifdef HAVE_SHIFTBBA
 void enterTShift(LObject p, kStrategy strat, int atT)
 {
