diff -Nurd qtiplot-0.9.8.9.orig/3rdparty/qwtplot3d/qwtplot3d.pri qtiplot-0.9.8.9/3rdparty/qwtplot3d/qwtplot3d.pri
--- qtiplot-0.9.8.9.orig/3rdparty/qwtplot3d/qwtplot3d.pri	2009-07-24 05:41:59.000000000 -0400
+++ qtiplot-0.9.8.9/3rdparty/qwtplot3d/qwtplot3d.pri	2022-02-11 23:30:47.000000000 -0500
@@ -4,8 +4,7 @@
 TARGET = qwtplot3d
 TEMPLATE = lib
 DEPENDPATH += src \
-    include \
-    3rdparty\gl2ps
+    include
 INCLUDEPATH += .
 
 # Input
@@ -37,8 +36,7 @@
     include/qwt3d_volumeplot.h \
     include/qwt3d_graphplot.h \
     include/qwt3d_multiplot.h \
-    include/qwt3d_io_gl2ps.h \
-    3rdparty/gl2ps/gl2ps.h
+    include/qwt3d_io_gl2ps.h
 SOURCES += src/qwt3d_extglwidget.cpp \
     src/qwt3d_axis.cpp \
     src/qwt3d_color.cpp \
@@ -62,5 +60,4 @@
     src/qwt3d_function.cpp \
     src/qwt3d_gridplot.cpp \
     src/qwt3d_meshplot.cpp \
-    src/qwt3d_io_gl2ps.cpp \
-    3rdparty/gl2ps/gl2ps.c
+    src/qwt3d_io_gl2ps.cpp
diff -Nurd qtiplot-0.9.8.9.orig/3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp qtiplot-0.9.8.9/3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp
--- qtiplot-0.9.8.9.orig/3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp	2011-08-24 06:25:09.000000000 -0400
+++ qtiplot-0.9.8.9/3rdparty/qwtplot3d/src/qwt3d_io_gl2ps.cpp	2022-02-12 00:27:17.000000000 -0500
@@ -6,7 +6,7 @@
 #include <locale.h>
 
 #include "qwt3d_openglhelper.h"
-#include "../3rdparty/gl2ps/gl2ps.h"
+#include "gl2ps.h"
 #include "qwt3d_io_gl2ps.h"
 #include "qwt3d_plot.h"
 
diff -Nurd qtiplot-0.9.8.9.orig/3rdparty/qwtplot3d/src/qwt3d_label.cpp qtiplot-0.9.8.9-gl2ps/3rdparty/qwtplot3d/src/qwt3d_label.cpp
--- qtiplot-0.9.8.9.orig/3rdparty/qwtplot3d/src/qwt3d_label.cpp	2011-08-24 06:25:09.000000000 -0400
+++ qtiplot-0.9.8.9-gl2ps/3rdparty/qwtplot3d/src/qwt3d_label.cpp	2022-02-12 00:27:15.000000000 -0500
@@ -1,7 +1,7 @@
 #include <qbitmap.h>
 #include "qwt3d_label.h"
 #include "qwt3d_plot.h"
-#include "../3rdparty/gl2ps/gl2ps.h"
+#include "gl2ps.h"
 
 using namespace Qwt3D;
 
diff -Nurd qtiplot-0.9.8.9.orig/qtiplot/qtiplot.pro qtiplot-0.9.8.9/qtiplot/qtiplot.pro
--- qtiplot-0.9.8.9.orig/qtiplot/qtiplot.pro	2011-11-02 12:55:25.000000000 -0400
+++ qtiplot-0.9.8.9/qtiplot/qtiplot.pro	2022-02-11 23:31:42.000000000 -0500
@@ -20,6 +20,7 @@
 LIBS         += $$QWT_LIBS
 LIBS         += $$QWT3D_LIBS
 LIBS         += $$GSL_LIBS
+LIBS         += -lgl2ps
 
 #############################################################################
 ###################### BASIC PROJECT PROPERTIES #############################
diff -Nurd qtiplot-0.9.8.9.orig/qtiplot/src/analysis/Correlation.cpp qtiplot-0.9.8.9/qtiplot/src/analysis/Correlation.cpp
--- qtiplot-0.9.8.9.orig/qtiplot/src/analysis/Correlation.cpp	2010-09-27 03:12:45.000000000 -0400
+++ qtiplot-0.9.8.9/qtiplot/src/analysis/Correlation.cpp	2022-02-11 23:32:04.000000000 -0500
@@ -157,7 +157,8 @@
 	d_table->addCol();
 	int n = d_n/2;
 
-    double x_temp[d_n], y_temp[d_n];
+	double *x_temp = new double[d_n];
+	double *y_temp = new double[d_n];
 	for (int i = 0; i<d_n; i++){
 	    double x = i - n;
         x_temp[i] = x;
@@ -192,4 +193,6 @@
 		d_output_graph->insertPlotItem(c, Graph::Line);
 		d_output_graph->updatePlot();
 	}
+	delete[] x_temp;
+	delete[] y_temp;
 }
diff -Nurd qtiplot-0.9.8.9.orig/qtiplot/src/analysis/Fit.cpp qtiplot-0.9.8.9/qtiplot/src/analysis/Fit.cpp
--- qtiplot-0.9.8.9.orig/qtiplot/src/analysis/Fit.cpp	2011-10-17 06:06:00.000000000 -0400
+++ qtiplot-0.9.8.9/qtiplot/src/analysis/Fit.cpp	2022-02-11 23:32:00.000000000 -0500
@@ -39,6 +39,7 @@
 #include <gsl/gsl_statistics.h>
 #include <gsl/gsl_blas.h>
 #include <gsl/gsl_cdf.h>
+#include <gsl/gsl_version.h>
 
 #include <QApplication>
 #include <QMessageBox>
@@ -126,10 +127,19 @@
 			break;
 		}
 	}
-
 	if (status){
+	    // allocate memory and calculate covariance matrix based on residuals
+#if GSL_MAJOR_VERSION == 2
+	    gsl_matrix *J = gsl_matrix_alloc(d_n, d_p);
+	    gsl_multifit_fdfsolver_jac(s, J);
+	    gsl_multifit_covar (J, 0.0, covar);
+	    iterations = 0;
+	    // free previousely allocated memory
+	    gsl_matrix_free (J);
+#else
 	    gsl_multifit_covar (s->J, 0.0, covar);
 	    iterations = 0;
+#endif
 	    return s;
 	}
 
@@ -154,10 +164,18 @@
 
 		status = gsl_multifit_test_delta (s->dx, s->x, d_tolerance, d_tolerance);
 	} while (inRange && status == GSL_CONTINUE && (int)iter < d_max_iterations);
-
+#if GSL_MAJOR_VERSION == 2
+	// allocate memory and calculate covariance matrix based on residuals
+	gsl_matrix *J = gsl_matrix_alloc(d_n, d_p);
+	gsl_multifit_fdfsolver_jac(s, J);
+	gsl_multifit_covar (J, 0.0, covar);
+	iterations = iter;
+	// free previousely allocated memory
+	gsl_matrix_free (J);
+#else
 	gsl_multifit_covar (s->J, 0.0, covar);
-
 	iterations = iter;
+#endif
 	return s;
 }
 
diff -Nurd qtiplot-0.9.8.9.orig/qtiplot/src/core/ApplicationWindow.cpp qtiplot-0.9.8.9/qtiplot/src/core/ApplicationWindow.cpp
--- qtiplot-0.9.8.9.orig/qtiplot/src/core/ApplicationWindow.cpp	2011-11-01 08:21:13.000000000 -0400
+++ qtiplot-0.9.8.9/qtiplot/src/core/ApplicationWindow.cpp	2022-02-11 23:31:50.000000000 -0500
@@ -16228,11 +16228,12 @@
 	if (hostInfo.error() != QHostInfo::NoError){
 		QApplication::restoreOverrideCursor();
 		QMessageBox::critical(this, tr("QtiPlot - Error"), qtiplotWeb + ": " + hostInfo.errorString());
-		exit(0);
+		QApplication::restoreOverrideCursor();
+	}
+	else {
+		QApplication::restoreOverrideCursor();
+		showDonationsPage();
 	}
-
-	QApplication::restoreOverrideCursor();
-	showDonationsPage();
 }
 
 void ApplicationWindow::parseCommandLineArguments(const QStringList& args)
diff -Nurd qtiplot-0.9.8.9.orig/qtiplot/src/table/Table.cpp qtiplot-0.9.8.9/qtiplot/src/table/Table.cpp
--- qtiplot-0.9.8.9.orig/qtiplot/src/table/Table.cpp	2011-09-13 07:20:29.000000000 -0400
+++ qtiplot-0.9.8.9/qtiplot/src/table/Table.cpp	2022-02-11 23:31:55.000000000 -0500
@@ -564,7 +564,7 @@
 	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
     muParserScript *mup = new muParserScript(scriptEnv, cmd, this,  QString("<%1>").arg(colName(col)));
-    double *r = mup->defineVariable("i");
+    double *r = mup->defineVariable("i",startRow + 1.0);
     mup->defineVariable("j", (double)col);
     mup->defineVariable("sr", startRow + 1.0);
     mup->defineVariable("er", endRow + 1.0);
