diff --git a/src/complex.cpp b/src/complex.cpp
index 2fcc14c..fb3498f 100755
--- a/src/complex.cpp
+++ b/src/complex.cpp
@@ -863,12 +863,12 @@ void MGL_EXPORT mgl_datac_insert_(uintptr_t *d, const char *dir, int *at, int *n
 void MGL_EXPORT mgl_datac_delete_(uintptr_t *d, const char *dir, int *at, int *num, int)
 {	mgl_datac_delete(_DC_,*dir,*at,*num);	}
 //-----------------------------------------------------------------------------
-void MGL_EXPORT mgl_datac_set_value(HADT dat, dual v, long i, long j, long k)
+void MGL_EXPORT mgl_datac_set_value(HADT dat, mdual v, long i, long j, long k)
 {
 	if(i>=0 && i<dat->nx && j>=0 && j<dat->ny && k>=0 && k<dat->nz)
 		dat->a[i+dat->nx*(j+dat->ny*k)]=v;
 }
-void MGL_EXPORT mgl_datac_set_value_(uintptr_t *d, dual *v, int *i, int *j, int *k)
+void MGL_EXPORT mgl_datac_set_value_(uintptr_t *d, mdual *v, int *i, int *j, int *k)
 {	mgl_datac_set_value(_DC_,*v,*i,*j,*k);	}
 //-----------------------------------------------------------------------------
 cmdual MGL_EXPORT mgl_datac_get_value(HCDT dat, long i, long j, long k)
diff --git a/src/complex_io.cpp b/src/complex_io.cpp
index 2fcd40a..49feb5c 100755
--- a/src/complex_io.cpp
+++ b/src/complex_io.cpp
@@ -343,14 +343,14 @@ void MGL_EXPORT mgl_datac_create(HADT d,long mx,long my,long mz)
 void MGL_EXPORT mgl_datac_create_(uintptr_t *d, int *nx,int *ny,int *nz)
 {	mgl_datac_create(_DC_,*nx,*ny,*nz);	}
 //-----------------------------------------------------------------------------
-void MGL_EXPORT mgl_datac_link(HADT d, dual *A, long mx,long my,long mz)
+void MGL_EXPORT mgl_datac_link(HADT d, mdual *A, long mx,long my,long mz)
 {
 	if(!A)	return;
 	if(!d->link && d->a)	delete [](d->a);
 	d->nx = mx>0 ? mx:1;	d->ny = my>0 ? my:1;	d->nz = mz>0 ? mz:1;
-	d->link=true;	d->a=A;	d->NewId();
+	d->link=true;	d->a=(dual*)A;	d->NewId();
 }
-void MGL_EXPORT mgl_datac_link_(uintptr_t *d, dual *A, int *nx,int *ny,int *nz)
+void MGL_EXPORT mgl_datac_link_(uintptr_t *d, mdual *A, int *nx,int *ny,int *nz)
 {	mgl_datac_link(_DC_,A,*nx,*ny,*nz);	}
 //-----------------------------------------------------------------------------
 int MGL_EXPORT mgl_datac_read_dim(HADT d, const char *fname,long mx,long my,long mz)
diff --git a/utils/mgltask.cpp b/utils/mgltask.cpp
index b9bb7da..4566512 100755
--- a/utils/mgltask.cpp
+++ b/utils/mgltask.cpp
@@ -2,6 +2,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#define _USE_MATH_DEFINES
 #include <math.h>
 #include <time.h>
 //===================================================================
@@ -100,7 +101,7 @@ int main(int argc, char *argv[])
 	double x1[10],x2[10],dx[10],x[10];
 	int k,i,n=argc-3;//=(argc==4) ? 1:2;
 	FILE *fm,*fo;
-	
+
 	// first place zeros
 	for(i=0;i<10;i++)
 	{
