Index: factory/cf_gcd_smallp.cc
===================================================================
--- factory/cf_gcd_smallp.cc	(revision d30a39922dc390f97b6cd257b2e7c55d483f4159)
+++ factory/cf_gcd_smallp.cc	(revision b37b3984a12e1552c7bafc9fd5a7849240ea7980)
@@ -4229,5 +4229,4 @@
   Evaluation result= Evaluation (A.min(), A.max());
   ASSERT (A.min() == 2, "expected A.min() == 2");
-  ASSERT (A.max() >= n, "expected A.max() >= n");
   int max_deg;
   int k= n;
Index: factory/facFqBivarUtil.cc
===================================================================
--- factory/facFqBivarUtil.cc	(revision d30a39922dc390f97b6cd257b2e7c55d483f4159)
+++ factory/facFqBivarUtil.cc	(revision b37b3984a12e1552c7bafc9fd5a7849240ea7980)
@@ -519,5 +519,8 @@
   }
 
-  q= newtonDiv (bufF, G, xToLOldL);
+  if (l-oldL > 0)
+    q= newtonDiv (bufF, G, xToLOldL);
+  else
+    q= 0;
   q *= xToOldL;
   q += oldQ;
Index: factory/facFqSquarefree.h
===================================================================
--- factory/facFqSquarefree.h	(revision d30a39922dc390f97b6cd257b2e7c55d483f4159)
+++ factory/facFqSquarefree.h	(revision b37b3984a12e1552c7bafc9fd5a7849240ea7980)
@@ -18,4 +18,5 @@
 #include "cf_factory.h"
 #include "fac_sqrfree.h"
+#include "cf_factory.h"
 
 /// squarefree factorization over a finite field
Index: factory/facHensel.cc
===================================================================
--- factory/facHensel.cc	(revision d30a39922dc390f97b6cd257b2e7c55d483f4159)
+++ factory/facHensel.cc	(revision b37b3984a12e1552c7bafc9fd5a7849240ea7980)
@@ -544,4 +544,5 @@
   }
 
+  setReduce (alpha, false);
   for (k= 0; k < factors.length(); k++)
   {
@@ -554,4 +555,5 @@
     }
   }
+  setReduce (alpha, true);
   setCharacteristic(0);
 
@@ -591,5 +593,7 @@
   }
   setCharacteristic (p);
+  setReduce (alpha, false);
   recResult= mapinto (recResult);
+  setReduce (alpha, true);
   if (mipoHasDen)
   {
@@ -606,5 +610,13 @@
     coeffE= div (e, modulus);
     setCharacteristic (p);
+    if (mipoHasDen)
+      setReduce (gamma, false);
+    else
+      setReduce (alpha, false);
     coeffE= coeffE.mapinto();
+    if (mipoHasDen)
+      setReduce (gamma, true);
+    else
+      setReduce (alpha, true);
     if (mipoHasDen)
       coeffE= replacevar (coeffE, gamma, beta);
@@ -619,12 +631,16 @@
       {
         setCharacteristic (p);
+        setReduce (alpha, false);
         g= mulNTL (coeffE, j.getItem());
         g= modNTL (g, bufFactors[ii]);
+        setReduce (alpha, true);
         setCharacteristic (0);
         if (mipoHasDen)
         {
+          setReduce (beta, false);
           k.getItem() += replacevar (g.mapinto()*modulus, beta, gamma);
           e -= mulNTL (replacevar (g.mapinto(), beta, gamma)*modulus,
                                    l.getItem(), b);
+          setReduce (beta, true);
         }
         else
Index: factory/facMul.cc
===================================================================
--- factory/facMul.cc	(revision d30a39922dc390f97b6cd257b2e7c55d483f4159)
+++ factory/facMul.cc	(revision b37b3984a12e1552c7bafc9fd5a7849240ea7980)
@@ -404,5 +404,12 @@
       {
         ZZ_p::init (convertFacCF2NTLZZ (b.getpk()));
-        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha)));
+        CanonicalForm mipo= getMipo (alpha);
+        bool is_rat= isOn (SW_RATIONAL);
+        if (!is_rat)
+          On (SW_RATIONAL);
+        mipo *=bCommonDen (mipo);
+        if (!is_rat)
+          Off (SW_RATIONAL);
+        ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (mipo));
         ZZ_pE::init (NTLmipo);
         ZZ_pEX NTLg= convertFacCF2NTLZZ_pEX (G, NTLmipo);
Index: factory/fac_ezgcd.cc
===================================================================
--- factory/fac_ezgcd.cc	(revision d30a39922dc390f97b6cd257b2e7c55d483f4159)
+++ factory/fac_ezgcd.cc	(revision b37b3984a12e1552c7bafc9fd5a7849240ea7980)
@@ -215,5 +215,4 @@
   Evaluation result= Evaluation (A.min(), A.max());
   ASSERT (A.min() == 2, "expected A.min() == 2");
-  ASSERT (A.max() == n, "expected A.max() == n");
   int max_deg;
   int k= n;
