Index: Singular/ipassign.cc
===================================================================
--- Singular/ipassign.cc	(revision 1085d42039758a8ec5ff857d7c0b1d53388050e6)
+++ Singular/ipassign.cc	(revision 3b1d9ad2203f374c5bb63a847f440d4759cd47c2)
@@ -17,5 +17,5 @@
 #include <misc/options.h>
 #include <Singular/ipid.h>
-#include <kernel/idrec.h>
+#include <Singular/idrec.h>
 #include <misc/intvec.h>
 #include <omalloc/omalloc.h>
@@ -30,5 +30,5 @@
 #include <Singular/lists.h>
 #include <coeffs/numbers.h>
-#include <kernel/longalg.h>
+#include <polys/ext_fields/longalg.h>
 #include <kernel/stairc.h>
 #include <polys/monomials/maps.h>
@@ -39,5 +39,5 @@
 #include <Singular/silink.h>
 #include <Singular/ipshell.h>
-#include <kernel/sca.h>
+#include <polys/nc/sca.h>
 #include <Singular/blackbox.h>
 
@@ -131,5 +131,5 @@
     {
       poly p=(poly)IDDATA(h);
-      IDDATA(h)=(char*)pMinPolyNormalize(p);
+      IDDATA(h)=(char*)p_MinPolyNormalize(p, currRing);
       break;
     }
@@ -141,5 +141,6 @@
       int i;
       ideal I=(ideal)IDDATA(h);
-      for(i=IDELEMS(I)-1;i>=0;i--) I->m[i]=pMinPolyNormalize(I->m[i]);
+      for(i=IDELEMS(I)-1;i>=0;i--)
+	      I->m[i]=p_MinPolyNormalize(I->m[i], currRing);
       break;
     }
@@ -169,5 +170,5 @@
   {
     if ((rPar(currRing)!=1)
-      || (rField_is_GF()))
+      || (rField_is_GF(currRing)))
     {
       WerrorS("no minpoly allowed");
@@ -486,6 +487,6 @@
   if (res->data!=NULL) idDelete((ideal*)&res->data);
   res->data=(void *)a->CopyD(MATRIX_CMD);
-  if (a->rtyp==IDHDL) idNormalize((ideal)a->Data());
-  else                idNormalize((ideal)res->data);
+  if (a->rtyp==IDHDL) id_Normalize((ideal)a->Data(), currRing);
+  else                id_Normalize((ideal)res->data, currRing);
   jiAssignAttr(res,a);
   if (((res->rtyp==IDEAL_CMD)||(res->rtyp==MODUL_CMD))
@@ -529,5 +530,5 @@
   ((ideal)m)->rank=1;
   MATROWS(m)=1;
-  idNormalize((ideal)m);
+  id_Normalize((ideal)m, currRing);
   res->data=(void *)m;
   if (TEST_V_QRING && (currQuotient!=NULL)) jjNormalizeQRingId(res);
@@ -579,5 +580,5 @@
   res->data=(void *)a->CopyD(IDEAL_CMD);
   f=(map)res->data;
-  idNormalize((ideal)f);
+  id_Normalize((ideal)f, currRing);
   f->preimage = rn;
   return FALSE;
Index: Singular/maps_ip.cc
===================================================================
--- Singular/maps_ip.cc	(revision 1085d42039758a8ec5ff857d7c0b1d53388050e6)
+++ Singular/maps_ip.cc	(revision 3b1d9ad2203f374c5bb63a847f440d4759cd47c2)
@@ -10,4 +10,5 @@
 
 #include "maps_ip.h"
+#include "ipid.h"
 
 #include <omalloc/omalloc.h>
@@ -18,4 +19,7 @@
 #include <polys/matpol.h>
 #include <polys/prCopy.h>
+#include <libpolys/polys/ext_fields/longtrans.h>
+#include <libpolys/polys/monomials/maps.h>
+#include <libpolys/coeffs/coeffs.h>
 
 // #include <kernel/longalg.h>
@@ -63,12 +67,12 @@
         res->data=(void *)napPermNumber((number)data,par_perm,P, preimage_r);
         res->rtyp=POLY_CMD;
-        if (currRing->minpoly!=NULL)
-          res->data=(void *)pMinPolyNormalize((poly)res->data);
+        if (nCoeff_is_Extension(currRing->cf))
+          res->data=(void *)p_MinPolyNormalize((poly)res->data, currRing);
         pTest((poly) res->data);
       }
       else
       {
-        res->data=(void *)nMap((number)data);
-        if (currRing->minpoly!=NULL)
+        res->data=(void *)nMap((number)data, preimage_r->cf, currRing->cf);
+        if (nCoeff_is_Extension(currRing->cf))
         {
           number a=(number)res->data;
@@ -86,17 +90,18 @@
     case POLY_CMD:
     case VECTOR_CMD:
-      if ((what==FETCH_CMD)&& (nMap==nCopy))
-        res->data=(void *)prCopyR( (poly)data, preimage_r);
+      if ((what==FETCH_CMD)&& (preimage_r->cf==currRing->cf))
+        res->data=(void *)prCopyR( (poly)data, preimage_r, currRing);
       else
       if ((what==IMAP_CMD) || ((what==FETCH_CMD) /* && (nMap!=nCopy)*/))
-        res->data=(void *)pPermPoly((poly)data,perm,preimage_r,nMap,par_perm,P);
+        res->data=(void *)p_PermPoly((poly)data,perm,preimage_r,currRing,
+			nMap,par_perm,P);
       else /*if (what==MAP_CMD)*/
       {
         matrix s=mpNew(N,maMaxDeg_P((poly)data, preimage_r));
-        res->data=(void *)maEval(theMap,(poly)data,preimage_r,nMap,s);
+        res->data=(void *)maEval(theMap,(poly)data,preimage_r,nMap,(ideal)s);
         idDelete((ideal *)&s);
       }
-      if (currRing->minpoly!=NULL)
-        res->data=(void *)pMinPolyNormalize((poly)res->data);
+      if (nCoeff_is_Extension(currRing->cf))
+        res->data=(void *)p_MinPolyNormalize((poly)res->data, currRing);
       pTest((poly)res->data);
       break;
@@ -117,9 +122,9 @@
         ((matrix)data)->rank=((matrix)data)->rows();
       }
-      if ((what==FETCH_CMD)&& (nMap==nCopy))
+      if ((what==FETCH_CMD)&& (preimage_r->cf == currRing->cf))
       {
         for (i=R*C-1;i>=0;i--)
         {
-          m->m[i]=prCopyR(((ideal)data)->m[i], preimage_r);
+          m->m[i]=prCopyR(((ideal)data)->m[i], preimage_r, currRing);
           pTest(m->m[i]);
         }
@@ -130,5 +135,6 @@
         for (i=R*C-1;i>=0;i--)
         {
-          m->m[i]=pPermPoly(((ideal)data)->m[i],perm,preimage_r,nMap,par_perm,P);
+          m->m[i]=p_PermPoly(((ideal)data)->m[i],perm,preimage_r,currRing,
+			  nMap,par_perm,P);
           pTest(m->m[i]);
         }
@@ -139,14 +145,14 @@
         for (i=R*C-1;i>=0;i--)
         {
-          m->m[i]=maEval(theMap,((ideal)data)->m[i],preimage_r,nMap,s);
+          m->m[i]=maEval(theMap,((ideal)data)->m[i],preimage_r,nMap,(ideal)s);
           pTest(m->m[i]);
         }
         idDelete((ideal *)&s);
       }
-      if (currRing->minpoly!=NULL)
+      if (nCoeff_is_Extension(currRing->cf))
       {
         for (i=R*C-1;i>=0;i--)
         {
-          m->m[i]=pMinPolyNormalize(m->m[i]);
+          m->m[i]=p_MinPolyNormalize(m->m[i], currRing);
           pTest(m->m[i]);
         }
@@ -208,5 +214,5 @@
 {
   ideal theMapI=idInit(rPar(currRing),1);
-  nMapFunc nMap=nSetMap(currRing->extRing);
+  nMapFunc nMap=n_SetMap(currRing->cf->extRing->cf, currRing->cf->extRing->cf);
 
   int i;
@@ -218,6 +224,6 @@
       pp=theMapI->m[i-1]=pOne();
       lnumber n=(lnumber)pGetCoeff(pp);
-      p_SetExp(n->z,i,1,currRing->extRing);
-      p_Setm(n->z,currRing->extRing);
+      p_SetExp(n->z,i,1,currRing->cf->extRing);
+      p_Setm(n->z,currRing->cf->extRing);
     }
     else
@@ -239,5 +245,5 @@
     tmpW.data=n->z;
     if (n->n!=NULL) WarnS("ignoring denominators of coefficients...");
-    if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing->extRing,NULL,NULL,0,nMap))
+    if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing->cf->extRing,NULL,NULL,0,nMap))
     {
       WerrorS("map failed");
@@ -312,5 +318,6 @@
     tmpW.data=p;
     leftv v=(leftv)omAlloc0Bin(sleftv_bin);
-    if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,nCopy))
+    if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,
+			    n_SetMap(currRing->cf, currRing->cf)))
     {
       WerrorS("map failed");
@@ -354,5 +361,6 @@
   tmpW.rtyp=IDEAL_CMD;
   tmpW.data=id;
-  if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,nCopy))
+  if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,
+			  n_SetMap(currRing->cf, currRing->cf)))
   {
     WerrorS("map failed");
Index: libpolys/polys/polys.h
===================================================================
--- libpolys/polys/polys.h	(revision 1085d42039758a8ec5ff857d7c0b1d53388050e6)
+++ libpolys/polys/polys.h	(revision 3b1d9ad2203f374c5bb63a847f440d4759cd47c2)
@@ -327,5 +327,5 @@
 
 
-#define   pSubst(p,n,e) p_Subst(p,n.e,currRing)
+#define   pSubst(p,n,e) p_Subst(p,n,e,currRing)
 #define   ppJet(p,m) pp_Jet(p,m,currRing)
 #define   pJet(p,m)  p_Jet(p,m,currRing)
