Index: Tst/Short/bug_qring.res.gz.uu
===================================================================
--- Tst/Short/bug_qring.res.gz.uu	(revision 1327a0002c1e1e8edbf06eba651a4e39a3a26c9d)
+++ Tst/Short/bug_qring.res.gz.uu	(revision 780e112edff75c0cf87a2cbc679791d1307e3f7e)
@@ -1,15 +1,17 @@
 begin 640 bug_qring.res.gz
-M'XL("-%?8$H``V)U9U]Q<FEN9RYR97,`A53;;IPP$'WG*T91'R#+$FZY[0H>
-MTBI2I&A?MF]5A+AX4ZM@6-M0P==W,"RP33=%`H_&9XYGSHS9?__VL@,`)X37
-MER>XDD):.4VNMMI^W'%#0&=$&96ZL=7Z%<(0DOH].G+*WBU&?EM"QG**\$*8
-M;-^"FQM@)2_B'`ZX0,PR2,NBRHDDL'L&RD#QB,T4=&O-!'<6]+M0!;:IMV9G
-MUF9CF%DU)W@?0EE)6C*=DVS_9,P[#^%`#<=`R$RG&8ESO5W5[JIN/+/KO\8"
-M_HCPK8;I`J0_8QZGDG`J)$UA`_;@9W61$`[E`9J8"_3[@U\]25ZFOWHMT5_R
-MC*BCLVJ!F)\-L+@@HC=;Z*"&YA]$[I+H:P\XUJ6DA,E!DP,O"U!5:=$/YRW`
-MPMIUA[:+=N.M>M-["]K&6W?]6Y]*=>QPB`,:H*:3!`Z.@5(*55&,ZW8U\B'O
-M"803L7O6!YQI&TJRZVN(@`KL-!)@BV.>01(+*C[AP3FA##7&MHULIV-';+L`
-M^Y@9D<,HS/G>GM5AGO=VAMU=&A'G?BKX8X\`SK,9U*Q=7'TE\,3RH!2)S,M3
-M]G=E`]<HBW\FR^-_9;F8B&LO8N<>?9+6!^H3DS-?8M>UU"^@O^2UT!UC^T7[
-)`];A*9`X!```
+M'XL("*+AGDX``V)U9U]Q<FEN9RYR97,`K51-;Z,P$+WG5XRJ/4!P*)BDS8?@
+MT%U5JK3*)7M;-9$=2-?:!!(PK,BO[X#YBAJJ5EVDQ)8]\^;-FQFO?OUX6@*`
+M[<'/IP>XD8DT]X+?+`:KZH9Z@(<;$0JIZ8M!L8+G`4]?-J=8A"]F&/PS$\ED
+MX^%XT.S')MS>0AC%![:''2[`0A^VT>&X#V0`RT<0(90XR;QQFI@MP)T)Q2T<
+M78MH.3F3E&0Z\8\MP7L/HJ,44:C%@;]ZT-N;J:>@X>0FTM>$'["]EALI-=+,
+M(>?B7^^8S]!\,4"Z`-L_+&9;&<0BD6(+<[#4>9@>>!!#M(.,Q0F>C]5Y^?%]
+MM/U;:(GG4>P'96C_V+%HOSF$[!`DQ3:',Z2070&B7:#OA<$IC:0(0JDTV<71
+M`<JL!IO?]K.+B>6C,^XI[C/'*+;.LYMGSNA<_-(Z5=ORE!\(%S5M)+"Q#4JE
+M4)42<90;%1[BUD;8$<M'3=D12R\E&PYA`R+!2B,`EIC%/G"6B.0='.P3$:+&
+M6+8*K0Y;V>:*?^4\OG`>(]-`JM9H^4\N\B*7M6[-[OI:QKYO!'A;,X!K[%*J
+MN&&`!F5:*K0A_5WWB4QG'Y3I"A%J=7S;FKU#ZPUTC62W0TUI-9,QN$")Q@CP
+MBY&D3I^^=-PAI"BP-25LR`U<F^B,J_",-HZ39I9/&+7-@*^I4;D3MN[.,\4J
+MGWH'FO8,-/WZ0#/@_V&8&>;%#4Z5$KRM:>][1Z<?$K>&1)%KQUE;7,<RR_>^
+2>-'31+/UQ;?!*X`@S@HE!@``
 `
 end
Index: Tst/Short/bug_qring.stat
===================================================================
--- Tst/Short/bug_qring.stat	(revision 1327a0002c1e1e8edbf06eba651a4e39a3a26c9d)
+++ Tst/Short/bug_qring.stat	(revision 780e112edff75c0cf87a2cbc679791d1307e3f7e)
@@ -1,4 +1,4 @@
-1 >> tst_memory_0 :: 1247829969:3104-2009071618:3-1-0:ix86-Linux:nepomuck:160292 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:173376
-1 >> tst_memory_1 :: 1247829969:3104-2009071618:3-1-0:ix86-Linux:nepomuck:707896 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:666308
-1 >> tst_memory_2 :: 1247829969:3104-2009071618:3-1-0:ix86-Linux:nepomuck:707896 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:699092
-1 >> tst_timer_1 :: 1247829969:3104-2009071618:3-1-0:ix86-Linux:nepomuck:2 1292524760:3120- 13145 :3-1-2:ix86-Linux:mamawutz:6
+1 >> tst_memory_0 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:174416
+1 >> tst_memory_1 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:666332
+1 >> tst_memory_2 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:699116
+1 >> tst_timer_1 :: 1319035298:3133- 14004 :3-1-3:ix86-Linux:mamawutz:8
Index: Tst/Short/bug_qring.tst
===================================================================
--- Tst/Short/bug_qring.tst	(revision 1327a0002c1e1e8edbf06eba651a4e39a3a26c9d)
+++ Tst/Short/bug_qring.tst	(revision 780e112edff75c0cf87a2cbc679791d1307e3f7e)
@@ -20,3 +20,11 @@
 interred(NF(std(i),std(ideal(y+u2+uv3,z+uv3))));
 
+ring r = 2,(a, b),dp;
+option(redSB);
+interred(ideal(a^2,a*b+a^2));
+qring qq = std(ideal(b^2+a*b+a^2,a^3));
+qq;
+option(redSB);
+interred(ideal(a^2,a*b+a^2));
+
 tst_status(1);$
Index: kernel/kstd1.cc
===================================================================
--- kernel/kstd1.cc	(revision 1327a0002c1e1e8edbf06eba651a4e39a3a26c9d)
+++ kernel/kstd1.cc	(revision 780e112edff75c0cf87a2cbc679791d1307e3f7e)
@@ -2315,5 +2315,5 @@
   strat->posInL=posInL0; /* ord according pComp */
 
-  /*Shdl=*/initBuchMora(F, Q,strat);
+  /*Shdl=*/initBuchMora(F, Q, strat);
   srmax = strat->sl;
   reduc = olddeg = lrmax = 0;
@@ -2469,5 +2469,8 @@
 
 #ifdef KDEBUG
-    messageSets(strat);
+    if (TEST_OPT_DEBUG)
+    {
+      messageSets(strat);
+    }
     memset(&(strat->P), 0, sizeof(strat->P));
 #endif
@@ -2537,6 +2540,22 @@
   int need_retry;
   int counter=3;
-  int elems=idElem(F);
-  ideal res=kInterRedBba(F,Q,need_retry);
+  ideal res, res1;
+  int elems;
+  ideal null=NULL;
+  if ((Q==NULL) || (!TEST_OPT_REDSB))
+  {
+    elems=idElem(F);
+    res=kInterRedBba(F,Q,need_retry);
+  }
+  else
+  {
+    ideal FF=idSimpleAdd(F,Q);
+    res=kInterRedBba(FF,NULL,need_retry);
+    idDelete(&FF);
+    null=idInit(1,1);
+    res1=kNF(null,Q,res);
+    idDelete(&res);
+    res=res1;
+  }
   while (need_retry && (counter>0))
   {
@@ -2544,16 +2563,22 @@
     if (TEST_OPT_DEBUG) { Print("retry counter %d\n",counter); }
     #endif
-    ideal res1=kInterRedBba(res,Q,need_retry);
+    res1=kInterRedBba(res,Q,need_retry);
     int new_elems=idElem(res1);
     counter -= (new_elems >= elems);
     elems = new_elems;
     idDelete(&res);
-    res = res1;
-  }
+    if ((Q!=NULL) && (TEST_OPT_REDSB))
+    {
+      res=kNF(null,Q,res1);
+      idDelete(&res1);
+    }
+    else
+      res = res1;
+  }
+  if (null!=NULL) idDelete(&null);
   test=save;
   idSkipZeroes(res);
   return res;
 }
-
 
 // returns TRUE if mora should use buckets, false otherwise
