diff --git a/src/ExtraParConstr.cc b/src/ExtraParConstr.cc
index 44eb7a27104a7a87243815980ba3dbbc9ab27590..f2b5a71fd1876046c8432e16099690b8b0f6e3cc 100644
--- a/src/ExtraParConstr.cc
+++ b/src/ExtraParConstr.cc
@@ -42,7 +42,7 @@ extern "C" {
 	}
 
 	// actual routine
-	void printminuitextrapars_() {
+	void printminuitextrapars_(int& iflag) {
 
 		int len=1024;
 		char parname[len];
@@ -82,6 +82,28 @@ extern "C" {
 			}
 			printf("\n");
 		}
+    if(iflag == 3)
+    {
+      int ndigcomma = 8;
+      printf("----- Parameters in YAML format (can copy paste into parameters.yamp):\n");
+      for(int p=0; p<extrapars_.nExtraParam; p++)
+      {
+        mnpout_(extrapars_.iExtraParamMinuit+p, parname, &par, &unc, &bound_l, &bound_h, &status, len);
+        //if(status<=0) continue;
+        parname[std::string(parname).find(' ')]='\0';
+        printf("  %s : [ %.*f, %.*f", parname, ndigcomma, par, ndigcomma, unc);
+        if(bound_l!=0.0&&bound_h!=0.0) {
+          printf("%.*f%.*f", ndigcomma, bound_l, ndigcomma, bound_h);
+        }
+        if(extrapars_.ConstrUnc[p]!=0.0) {
+          double shift=(par-extrapars_.ConstrVal[p])/extrapars_.ConstrUnc[p];
+          double reduction=unc/extrapars_.ConstrUnc[p];
+          printf("%.*f%.*f", ndigcomma, shift, ndigcomma, reduction);
+        }
+        printf(" ]\n");
+      }
+      printf("----- End of parameters in YAML format\n");
+    }
 	}
 }
 
diff --git a/src/fcn.f b/src/fcn.f
index 7c7193a53e2b089d665dd648c1be1a93ea370808..646944967a4f494bcb1d2a576ee0c50e9c04054d 100644
--- a/src/fcn.f
+++ b/src/fcn.f
@@ -61,7 +61,7 @@ C !> Also store for each fcn=3 call:
 
 C     Print MINUIT extra parameters
 c which are actually all parameters
-      call printminuitextrapars
+      call printminuitextrapars(iflag)
 C Copy new parameter values from MINUIT to whereever parameterisations
 c will take them from
       call copy_minuit_extrapars(parminuit)
diff --git a/tools/draw/src/PdfsPainter.cc b/tools/draw/src/PdfsPainter.cc
index 791b9c8660a2f43533ff943998734b9280b41f3f..a18570bbd90bd45e53d1cc8159a14fea33ba47eb 100644
--- a/tools/draw/src/PdfsPainter.cc
+++ b/tools/draw/src/PdfsPainter.cc
@@ -77,8 +77,14 @@ vector <TCanvas*> PdfsPainter(double q2, pdftype ipdf)
     for(const auto&graph:pdfgraphs){
       if(!graph)continue;
       TAxis*ax=graph->GetXaxis();
-      opts.xmin=min(opts.xmin,ax->GetXmin());
-      opts.xmax=max(opts.xmax,ax->GetXmax());
+      double xmin = ax->GetXmin();
+      if(xmin < 0.0 || (xmin == 0.0 && opts.logx))
+        xmin = graph->GetX()[0];
+      opts.xmin = min(opts.xmin, xmin);
+      double xmax = ax->GetXmax();
+      if(xmax > 1.0)
+        xmax = graph->GetX()[graph->GetN() - 1];
+      opts.xmax=max(opts.xmax, xmax);
     }
   }