Index: libpolys/polys/ext_fields/transext.cc
===================================================================
--- libpolys/polys/ext_fields/transext.cc	(revision 5a4e17def42b997c5643711c5553f5008753b451)
+++ libpolys/polys/ext_fields/transext.cc	(revision 0635d513a4904575a4a7bacb750e17cd54a02089)
@@ -1400,9 +1400,57 @@
   poly pb = p_Copy(DEN(fb), ntRing);
 
+  poly pGcd;
+  if (nCoeff_is_Q(ntCoeffs))
+  {
+    if (p_IsConstant(pa,ntRing) && p_IsConstant(pb,ntRing))
+    {
+      pGcd = pa;
+      p_SetCoeff (pGcd, n_Gcd (pGetCoeff(pGcd), pGetCoeff(pb), ntCoeffs), ntRing);
+    }
+    else
+    {
+      number contentpa, contentpb, tmp;
+
+      contentpb= p_GetCoeff(pb, ntRing);
+      pIter(pb);
+      while (pb != NULL)
+      {
+        tmp = n_Gcd(contentpb, p_GetCoeff(pb, ntRing) , ntCoeffs);
+        n_Delete(&contentpb, ntCoeffs);
+        contentpb = tmp;
+        pIter(pb);
+      }
+
+      contentpa= p_GetCoeff(pa, ntRing);
+      pIter(pa);
+      while (pa != NULL)
+      {
+        tmp = n_Gcd(contentpa, p_GetCoeff(pa, ntRing), ntCoeffs);
+        n_Delete(&contentpa, ntCoeffs);
+        contentpa = tmp;
+        pIter(pa);
+      }
+
+      tmp= n_Gcd (contentpb, contentpa, ntCoeffs);
+      n_Delete(&contentpa, ntCoeffs);
+      n_Delete(&contentpb, ntCoeffs);
+      contentpa= tmp;
+      p_Delete(&pb, ntRing);
+      p_Delete(&pa, ntRing);
+
+      /* singclap_gcd destroys its arguments; we hence need copies: */
+      pGcd = singclap_gcd(p_Copy(NUM(fa),ntRing), p_Copy(DEN(fb),ntRing), ntRing);
+      pGcd= p_Mult_nn (pGcd, contentpa, ntRing);
+      n_Delete(&contentpa, ntCoeffs);
+    }
+  }
+  else
+    pGcd = singclap_gcd(pa, pb, cf->extRing);
+
   /* Note that, over Q, singclap_gcd will remove the denominators in all
      rational coefficients of pa and pb, before starting to compute
      the gcd. Thus, we do not need to ensure that the coefficients of
      pa and pb live in Z; they may well be elements of Q\Z. */
-  poly pGcd = singclap_gcd(pa, pb, ntRing);
+
   if (p_IsConstant(pGcd, ntRing) &&
       n_IsOne(p_GetCoeff(pGcd, ntRing), ntCoeffs))
@@ -1442,13 +1490,60 @@
   fraction fa = (fraction)a;
   fraction fb = (fraction)b;
-  /* singclap_gcd destroys its arguments; we hence need copies: */
+
   poly pa = p_Copy(NUM(fa), ntRing);
   poly pb = p_Copy(NUM(fb), ntRing);
 
+  poly pGcd;
+  if (nCoeff_is_Q(ntCoeffs))
+  {
+    if (p_IsConstant(pa,ntRing) && p_IsConstant(pb,ntRing))
+    {
+      pGcd = pa;
+      p_SetCoeff (pGcd, n_Gcd (pGetCoeff(pGcd), pGetCoeff(pb), ntCoeffs), ntRing);
+    }
+    else
+    {
+      number contentpa, contentpb, tmp;
+
+      contentpb= p_GetCoeff(pb, ntRing);
+      pIter(pb);
+      while (pb != NULL)
+      {
+        tmp = n_Gcd(contentpb, p_GetCoeff(pb, ntRing) , ntCoeffs);
+        n_Delete(&contentpb, ntCoeffs);
+        contentpb = tmp;
+        pIter(pb);
+      }
+
+      contentpa= p_GetCoeff(pa, ntRing);
+      pIter(pa);
+      while (pa != NULL)
+      {
+        tmp = n_Gcd(contentpa, p_GetCoeff(pa, ntRing), ntCoeffs);
+        n_Delete(&contentpa, ntCoeffs);
+        contentpa = tmp;
+        pIter(pa);
+      }
+
+      tmp= n_Gcd (contentpb, contentpa, ntCoeffs);
+      n_Delete(&contentpa, ntCoeffs);
+      n_Delete(&contentpb, ntCoeffs);
+      contentpa= tmp;
+      p_Delete(&pb, ntRing);
+      p_Delete(&pa, ntRing);
+
+      /* singclap_gcd destroys its arguments; we hence need copies: */
+      pGcd = singclap_gcd(p_Copy(NUM(fa),ntRing), p_Copy(NUM(fb),ntRing), ntRing);
+      pGcd= p_Mult_nn (pGcd, contentpa, ntRing);
+      n_Delete(&contentpa, ntCoeffs);
+    }
+  }
+  else
+    pGcd = singclap_gcd(pa, pb, cf->extRing);
   /* Note that, over Q, singclap_gcd will remove the denominators in all
      rational coefficients of pa and pb, before starting to compute
      the gcd. Thus, we do not need to ensure that the coefficients of
      pa and pb live in Z; they may well be elements of Q\Z. */
-  poly pGcd = singclap_gcd(pa, pb, cf->extRing);
+
   fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
   NUM(result) = pGcd;
