Index: factory/DegreePattern.cc
===================================================================
--- factory/DegreePattern.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/DegreePattern.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -34,5 +34,5 @@
   int p= getCharacteristic();
   int d= 0;
-  char cGFName;
+  char cGFName= 'Z';
   if (CFFactory::gettype() == GaloisFieldDomain)
   {
Index: factory/FLINTconvert.cc
===================================================================
--- factory/FLINTconvert.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/FLINTconvert.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -265,5 +265,6 @@
 {
   CFFList result;
-  result.insert (CFFactor (CanonicalForm ((long) leadingCoeff), 1));
+  if (leadingCoeff != 1)
+    result.insert (CFFactor (CanonicalForm ((long) leadingCoeff), 1));
 
   long i;
Index: factory/cfNewtonPolygon.cc
===================================================================
--- factory/cfNewtonPolygon.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/cfNewtonPolygon.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -601,5 +601,5 @@
 {
   int n;
-  int ** newtonPolyg;
+  int ** newtonPolyg= NULL;
   if (computeMA)
   {
Index: factory/cf_factor.cc
===================================================================
--- factory/cf_factor.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/cf_factor.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -441,4 +441,5 @@
       F= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, f.mvar());
       nmod_poly_factor_clear (result);
+      nmod_poly_clear (f1);
 #else
 #ifdef HAVE_NTL
@@ -542,5 +543,4 @@
       else
 #endif //HAVE_NTL
-#endif //HAVE_FLINT
       {  // Use Factory without NTL
         if ( isOn( SW_BERLEKAMP ) )
@@ -549,4 +549,5 @@
           F=FpFactorizeUnivariateCZ( f, issqrfree, 0, Variable(), Variable() );
       }
+#endif //HAVE_FLINT
     }
     else
Index: factory/cf_gcd_smallp.cc
===================================================================
--- factory/cf_gcd_smallp.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/cf_gcd_smallp.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -1596,6 +1596,5 @@
   bool fail= false;
   bool inextension= false;
-  bool inextensionextension= false;
-  bool topLevel2= false;
+  topLevel= false;
   CFList source, dest;
   int bound1= degree (ppA, 1);
@@ -1614,5 +1613,5 @@
       G_random_element=
       GCD_small_p (ppA (random_element,x), ppB (random_element,x),
-                   coF_random_element, coG_random_element, topLevel2,
+                   coF_random_element, coG_random_element, topLevel,
                    list);
       TIMING_END_AND_PRINT (gcd_recursion,
@@ -1627,5 +1626,5 @@
       GCD_Fp_extension (ppA (random_element, x), ppB (random_element, x),
                         coF_random_element, coG_random_element, alpha,
-                        list, topLevel2);
+                        list, topLevel);
       TIMING_END_AND_PRINT (gcd_recursion,
                             "time for recursive call: ");
@@ -1653,5 +1652,5 @@
       GCD_Fp_extension (ppA (random_element, x), ppB (random_element, x),
                         coF_random_element, coG_random_element, alpha,
-                        list, topLevel2);
+                        list, topLevel);
       TIMING_END_AND_PRINT (gcd_recursion,
                             "time for recursive call: ");
@@ -1698,5 +1697,4 @@
       DEBOUTLN (cerr, "getMipo (alpha)= " << getMipo (V_buf2));
 
-      inextensionextension= true;
       for (CFListIterator i= l; i.hasItem(); i++)
         i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem,
@@ -1722,5 +1720,5 @@
       GCD_Fp_extension (ppA (random_element, x), ppB (random_element, x),
                         coF_random_element, coG_random_element, V_buf,
-                        list, topLevel2);
+                        list, topLevel);
       TIMING_END_AND_PRINT (gcd_recursion,
                             "time for recursive call: ");
@@ -3023,5 +3021,4 @@
     }
 
-    long rk;
     matColumns= biggestSize2 - 1;
     matRows= 0;
@@ -3029,7 +3026,7 @@
     {
       if (V_buf.level() == 1)
-        rk= gaussianElimFp (pMat[i], pL[i]);
+        (void) gaussianElimFp (pMat[i], pL[i]);
       else
-        rk= gaussianElimFq (pMat[i], pL[i], V_buf);
+        (void) gaussianElimFq (pMat[i], pL[i], V_buf);
 
       if (pMat[i] (coeffMonoms[i].size(), coeffMonoms[i].size()) == 0)
@@ -3706,5 +3703,4 @@
   topLevel= false;
   bool inextension= false;
-  bool inextensionextension= false;
   Variable V_buf, alpha;
   CanonicalForm prim_elem, im_prim_elem;
@@ -3807,5 +3803,4 @@
       DEBOUTLN (cerr, "getMipo (alpha)= " << getMipo (V_buf2));
 
-      inextensionextension= true;
       for (CFListIterator i= l; i.hasItem(); i++)
         i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem,
@@ -4009,5 +4004,4 @@
           DEBOUTLN (cerr, "getMipo (alpha)= " << getMipo (V_buf2));
 
-          inextensionextension= true;
           for (CFListIterator i= l; i.hasItem(); i++)
             i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem,
Index: factory/facFactorize.cc
===================================================================
--- factory/facFactorize.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/facFactorize.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -321,5 +321,5 @@
   if (!pass)
   {
-    int lev;
+    int lev= 0;
     for (int i= 1; i <= LCF.level(); i++)
     {
Index: factory/facFqBivar.cc
===================================================================
--- factory/facFqBivar.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/facFqBivar.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -41,4 +41,8 @@
 #include "NTLconvert.h"
 
+#ifdef HAVE_FLINT
+#include "FLINTconvert.h"
+#endif
+
 TIMING_DEFINE_PRINT(fac_uni_factorizer)
 TIMING_DEFINE_PRINT(fac_hensel_lift12)
@@ -145,5 +149,7 @@
 {
   Variable x= A.mvar();
-  ASSERT (A.isUnivariate() || A.inCoeffDomain(), 
+  if (A.inCoeffDomain())
+    return CFList();
+  ASSERT (A.isUnivariate(),
           "univariate polynomial expected or constant expected");
   CFFList factorsA;
@@ -215,4 +221,16 @@
   else
   {
+#ifdef HAVE_FLINT
+    nmod_poly_t FLINTA;
+    convertFacCF2nmod_poly_t (FLINTA, A);
+    nmod_poly_factor_t result;
+    nmod_poly_factor_init (result);
+    mp_limb_t leadingCoeff= nmod_poly_factor (result, FLINTA);
+    factorsA= convertFLINTnmod_poly_factor2FacCFFList (result, leadingCoeff, x);
+    if (factorsA.getFirst().factor().inCoeffDomain())
+      factorsA.removeFirst();
+    nmod_poly_factor_clear (result);
+    nmod_poly_clear (FLINTA);
+#else
     if (getCharacteristic() > 2)
     {
@@ -232,4 +250,5 @@
                                                           x);
     }
+#endif
   }
   CFList uniFactors;
@@ -648,5 +667,5 @@
   zz_p::init (getCharacteristic());
   zz_pX NTLIrredpoly;
-  int i, m;
+  int i=1, m= 2;
   // extension of F_p needed
   if (alpha.level() == 1 && beta.level() == 1 && k == 1)
@@ -2265,5 +2284,4 @@
                   )
 {
-  bool irreducible= false;
   int d;
   int* bounds= computeBounds (F, d);
@@ -2328,5 +2346,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           delete [] A;
           delete [] bounds;
@@ -2398,5 +2415,4 @@
                   )
 {
-  bool irreducible= false;
   int d;
   int* bounds= computeBounds (F, d);
@@ -2461,5 +2477,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           delete [] A;
           delete [] bounds;
@@ -2533,5 +2548,4 @@
   int degMipo= degree (getMipo (info.getAlpha()));
   Variable alpha= info.getAlpha();
-  bool irreducible= false;
   int d;
   int* bounds= computeBounds (F, d);
@@ -2650,5 +2664,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           Variable y= Variable (2);
           CanonicalForm tmp= F (y - evaluation, y);
@@ -2722,5 +2735,4 @@
                     const Variable& alpha, int precision)
 {
-  bool irreducible= false;
   int d;
   int* bounds= computeBounds (F, d);
@@ -2786,5 +2798,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           delete [] A;
           delete [] bounds;
@@ -2844,5 +2855,4 @@
                        )
 {
-  bool irreducible= false;
   int d;
   int* bounds= computeBounds (F, d);
@@ -2908,5 +2918,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           delete [] A;
           delete [] bounds;
@@ -2976,5 +2985,4 @@
 {
   CFList result= CFList();
-  bool irreducible= false;
   CFArray * A= new CFArray [factors.length()];
   int oldL2= oldL/2;
@@ -3033,5 +3041,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           delete [] A;
           return CFList (F);
@@ -3041,5 +3048,4 @@
     if (NTLN.NumCols() == 1)
     {
-      irreducible= true;
       delete [] A;
       return CFList (F);
@@ -3083,5 +3089,4 @@
 {
   CFList result= CFList();
-  bool irreducible= false;
   CFArray * A= new CFArray [factors.length()];
   int oldL2= oldL/2;
@@ -3137,5 +3142,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           delete [] A;
           return CFList (F);
@@ -3145,5 +3149,4 @@
     if (NTLN.NumCols() == 1)
     {
-      irreducible= true;
       delete [] A;
       return CFList (F);
@@ -3191,5 +3194,4 @@
 {
   CFList result= CFList();
-  bool irreducible= false;
   CFArray * A= new CFArray [factors.length()];
   int oldL2= oldL/2; //be careful
@@ -3302,5 +3304,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           Variable y= Variable (2);
           CanonicalForm tmp= F (y - evaluation, y);
@@ -3314,5 +3315,4 @@
     if (NTLN.NumCols() == 1)
     {
-      irreducible= true;
       Variable y= Variable (2);
       CanonicalForm tmp= F (y - evaluation, y);
@@ -3363,5 +3363,4 @@
 {
   CFList result= CFList();
-  bool irreducible= false;
   CFArray * A= new CFArray [factors.length()];
   int extensionDeg= degree (getMipo (alpha));
@@ -3418,5 +3417,4 @@
         if (NTLN.NumCols() == 1)
         {
-          irreducible= true;
           delete [] A;
           return CFList (F);
Index: factory/facFqBivarUtil.cc
===================================================================
--- factory/facFqBivarUtil.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/facFqBivarUtil.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -669,5 +669,4 @@
   int** newtonPolyg= newtonPolygon (F, sizeOfNewtonPolygon);
 
-  int minXIndex= 0, minYIndex= 0, maxXIndex= 0, maxYIndex= 0;
   int minX, minY, maxX, maxY;
   minX= newtonPolyg [0] [0];
@@ -678,23 +677,11 @@
   {
     if (minX > newtonPolyg [i] [0])
-    {
       minX= newtonPolyg [i] [0];
-      minXIndex= i;
-    }
     if (maxX < newtonPolyg [i] [0])
-    {
       maxX= newtonPolyg [i] [0];
-      maxXIndex= i;
-    }
     if (minY > newtonPolyg [i] [1])
-    {
       minY= newtonPolyg [i] [1];
-      minYIndex= i;
-    }
     if (maxY < newtonPolyg [i] [1])
-    {
       maxY= newtonPolyg [i] [1];
-      maxYIndex= i;
-    }
   }
 
Index: factory/facFqFactorize.cc
===================================================================
--- factory/facFqFactorize.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/facFqFactorize.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -1499,5 +1499,5 @@
   if (!pass)
   {
-    int lev;
+    int lev= 0;
     // LCF is non-constant here
     for (int i= 1; i <= LCF.level(); i++)
Index: factory/facMul.cc
===================================================================
--- factory/facMul.cc	(revision 5c0bf0e51f96eb0ce4f2b693d76e67b7ab513d4e)
+++ factory/facMul.cc	(revision c8302bb70ef743b5705287005391184566e69b06)
@@ -107,6 +107,4 @@
 
   fmpz_poly_t FLINTA,FLINTB;
-  fmpz_poly_init (FLINTA);
-  fmpz_poly_init (FLINTB);
   kronSub (FLINTA, A, d);
   kronSub (FLINTB, B, d);
@@ -217,6 +215,4 @@
 
   fmpz_poly_t FLINTA,FLINTB;
-  fmpz_poly_init (FLINTA);
-  fmpz_poly_init (FLINTB);
   kronSub (FLINTA, A, d);
   kronSub (FLINTB, B, d);
@@ -1357,12 +1353,7 @@
 
   nmod_poly_t F1, F2;
-  mp_limb_t ninv= n_preinvert_limb (getCharacteristic());
-  nmod_poly_init_preinv (F1, getCharacteristic(), ninv);
-  nmod_poly_init_preinv (F2, getCharacteristic(), ninv);
   kronSubReciproFp (F1, F2, F, d1);
 
   nmod_poly_t G1, G2;
-  nmod_poly_init_preinv (G1, getCharacteristic(), ninv);
-  nmod_poly_init_preinv (G2, getCharacteristic(), ninv);
   kronSubReciproFp (G1, G2, G, d1);
 
@@ -1409,7 +1400,4 @@
 
   nmod_poly_t FLINTA, FLINTB;
-  mp_limb_t ninv= n_preinvert_limb (getCharacteristic());
-  nmod_poly_init_preinv (FLINTA, getCharacteristic(), ninv);
-  nmod_poly_init_preinv (FLINTB, getCharacteristic(), ninv);
   kronSubFp (FLINTA, A, d1);
   kronSubFp (FLINTB, B, d1);
@@ -1434,11 +1422,7 @@
 
   fmpz_poly_t F1, F2;
-  fmpz_poly_init (F1);
-  fmpz_poly_init (F2);
   kronSubReciproQ (F1, F2, F, d1);
 
   fmpz_poly_t G1, G2;
-  fmpz_poly_init (G1);
-  fmpz_poly_init (G2);
   kronSubReciproQ (G1, G2, G, d1);
 
@@ -1483,6 +1467,4 @@
 
   fmpz_poly_t FLINTA, FLINTB;
-  fmpz_poly_init (FLINTA);
-  fmpz_poly_init (FLINTB);
   kronSub (FLINTA, A, d1);
   kronSub (FLINTB, B, d1);
