Index: kernel/ideals.cc
===================================================================
--- kernel/ideals.cc	(revision 79ea4809aa81094eb116bd40570e1ef79259ab31)
+++ kernel/ideals.cc	(revision f9591af2831fa1de12e466051a60fd165adecaee)
@@ -696,7 +696,7 @@
       {
         if (p_MinComp(s_h3->m[j],syz_ring) > k)
-          p_Shift(&s_h3->m[j], -k,currRing);
+          p_Shift(&s_h3->m[j], -k,syz_ring);
         else
-          pDelete(&s_h3->m[j]);
+          p_Delete(&s_h3->m[j],syz_ring);
       }
     }
@@ -727,5 +727,5 @@
         e->m[j] = s_h3->m[j];
         isMonomial=isMonomial && (pNext(s_h3->m[j])==NULL);
-        pDelete(&pNext(s_h3->m[j]));
+        p_Delete(&pNext(s_h3->m[j]),syz_ring);
         s_h3->m[j] = NULL;
       }
@@ -918,5 +918,5 @@
         }
         else
-          pDelete(&(s_h3->m[j]));
+          p_Delete(&(s_h3->m[j]),currRing);
       }
     }
@@ -1099,5 +1099,5 @@
     {
       if ((s_h3->m[j] != NULL) && (pMinComp(s_h3->m[j]) > k))
-        pDelete(&(s_h3->m[j]));
+        p_Delete(&(s_h3->m[j]),currRing);
     }
   }
@@ -1265,5 +1265,5 @@
         pNormalize(p);
         if((w==NULL)&&(pDeg(p0)>n)||(w!=NULL)&&(pDegW(p0,w)>n))
-          pDelete(&p0);
+          p_Delete(&p0,currRing);
         else
           MATELEM(T,j+1,i+1)=pAdd(MATELEM(T,j+1,i+1),p0);
@@ -1279,5 +1279,5 @@
           if(((w==NULL)&&(pDeg(p0)>n))
           ||((w!=NULL)&&(pDegW(p0,w)>n)))
-            pDelete(&p0);
+            p_Delete(&p0,currRing);
           else
             R->m[i]=pAdd(R->m[i],p0);
@@ -1476,5 +1476,5 @@
     }
     else
-      pDelete(&s_h3->m[i]);
+      p_Delete(&s_h3->m[i],currRing);
   }
   if (resultIsIdeal)
@@ -1782,5 +1782,5 @@
             q = p;
             p = kNF(R,currQuotient,q);
-            pDelete(&q);
+            p_Delete(&q,currRing);
           }
           /*delete the matrix tmp*/
@@ -1846,5 +1846,5 @@
           q = p;
           p = kNF(R,currQuotient,q);
-          pDelete(&q);
+          p_Delete(&q,currRing);
         }
         if (p!=NULL)
@@ -1952,5 +1952,5 @@
       if (p != NULL)
       {
-        pDelete(&p);
+        p_Delete(&p,currRing);
         return FALSE;
       }
@@ -2219,5 +2219,5 @@
     && (pGetComp(s_temp1->m[i])<=length))
     {
-      pDelete(&(s_temp1->m[i]));
+      p_Delete(&(s_temp1->m[i]),currRing);
     }
     else
@@ -2342,6 +2342,6 @@
   *pos = idIndexOfKBase(base,kbase);
   if (*pos<0)
-    pDelete(&coeff);
-  pDelete(&base);
+    p_Delete(&coeff,currRing);
+  p_Delete(&base,currRing);
   return coeff;
 }
@@ -2383,5 +2383,5 @@
       }
       else
-        pDelete(&q);
+        p_Delete(&q,currRing);
       pIter(p);
     }
@@ -2470,5 +2470,5 @@
   idDelete(&S);
   poly gcd_p=singclap_pdivide(f,gg,r);
-  pDelete(&gg);
+  p_Delete(&gg,r);
   rChangeCurrRing(save_r);
   return gcd_p;
@@ -2484,5 +2484,5 @@
 */
 #ifdef HAVE_FACTORY
-ideal idChineseRemainder(ideal *xx, number *q, int rl)
+ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring R)
 {
   int cnt=IDELEMS(xx[0])*xx[0]->nrows;
@@ -2503,32 +2503,32 @@
         h=xx[j]->m[i];
         if ((h!=NULL)
-        &&((r==NULL)||(pLmCmp(r,h)==-1)))
+        &&((r==NULL)||(p_LmCmp(r,h,R)==-1)))
           r=h;
       }
       if (r==NULL) break;
-      h=pHead(r);
+      h=p_Head(r,R);
       for(j=rl-1;j>=0;j--)
       {
         hh=xx[j]->m[i];
-        if ((hh!=NULL) && (pLmCmp(r,hh)==0))
+        if ((hh!=NULL) && (p_LmCmp(r,hh,R)==0))
         {
           x[j]=pGetCoeff(hh);
-          hh=pLmFreeAndNext(hh);
+          hh=p_LmFreeAndNext(hh,R);
           xx[j]->m[i]=hh;
         }
         else
-          x[j]=nlInit(0, currRing);
-      }
-      number n=nlChineseRemainder(x,q,rl);
+          x[j]=n_Init(0, R->cf);
+      }
+      number n=n_ChineseRemainder(x,q,rl,R->cf);
       for(j=rl-1;j>=0;j--)
       {
         x[j]=NULL; // nlInit(0...) takes no memory
       }
-      if (nlIsZero(n)) pDelete(&h);
+      if (n_IsZero(n,R->cf)) p_Delete(&h,R);
       else
       {
-        pSetCoeff(h,n);
+        p_SetCoeff(h,n,R);
         //Print("new mon:");pWrite(h);
-        res_p=pAdd(res_p,h);
+        res_p=p_Add_q(res_p,h,R);
       }
     }
@@ -2536,5 +2536,5 @@
   }
   omFree(x);
-  for(i=rl-1;i>=0;i--) idDelete(&(xx[i]));
+  for(i=rl-1;i>=0;i--) id_Delete(&(xx[i]),R);
   omFree(xx);
   return result;
@@ -2557,5 +2557,5 @@
  * lift ideal with coeffs over Z (mod N) to Q via Farey
  */
-ideal idFarey(ideal x, number N)
+ideal id_Farey(ideal x, number N, const ring r)
 {
   int cnt=IDELEMS(x)*x->nrows;
@@ -2567,23 +2567,23 @@
   for(i=cnt-1;i>=0;i--)
   {
-    poly h=pCopy(x->m[i]);
+    poly h=p_Copy(x->m[i],r);
     result->m[i]=h;
     while(h!=NULL)
     {
       number c=pGetCoeff(h);
-      pSetCoeff0(h,nlFarey(c,N));
-      nDelete(&c);
+      pSetCoeff0(h,n_Farey(c,N,r->cf));
+      n_Delete(&c,r->cf);
       pIter(h);
     }
-    while((result->m[i]!=NULL)&&(nIsZero(pGetCoeff(result->m[i]))))
-    {
-      pLmDelete(&(result->m[i]));
+    while((result->m[i]!=NULL)&&(n_IsZero(pGetCoeff(result->m[i]),r->cf)))
+    {
+      p_LmDelete(&(result->m[i]),r);
     }
     h=result->m[i];
     while((h!=NULL) && (pNext(h)!=NULL))
     {
-      if(nIsZero(pGetCoeff(pNext(h))))
-      {
-        pLmDelete(&pNext(h));
+      if(n_IsZero(pGetCoeff(pNext(h)),r->cf))
+      {
+        p_LmDelete(&pNext(h),r);
       }
       else pIter(h);
Index: kernel/ideals.h
===================================================================
--- kernel/ideals.h	(revision 79ea4809aa81094eb116bd40570e1ef79259ab31)
+++ kernel/ideals.h	(revision f9591af2831fa1de12e466051a60fd165adecaee)
@@ -188,7 +188,7 @@
 poly id_GCD(poly f, poly g, const ring r);
 
-ideal idChineseRemainder(ideal *x, number *q, int rl);
+ideal id_ChineseRemainder(ideal *x, number *q, int rl, const ring R);
 //ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
-ideal idFarey(ideal x, number N);
+ideal id_Farey(ideal x, number N, const ring r);
 
 ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing); // image of certain map for BGG
Index: libpolys/coeffs/coeffs.h
===================================================================
--- libpolys/coeffs/coeffs.h	(revision 79ea4809aa81094eb116bd40570e1ef79259ab31)
+++ libpolys/coeffs/coeffs.h	(revision f9591af2831fa1de12e466051a60fd165adecaee)
@@ -566,5 +566,5 @@
 }
 
-static inline number n_farey(number a, number b, const coeffs r)
+static inline number n_Farey(number a, number b, const coeffs r)
 {
   assume(r != NULL);
