Index: /issm/trunk-jpl/src/c/cores/controlvalidation_core.cpp
===================================================================
--- /issm/trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18026)
+++ /issm/trunk-jpl/src/c/cores/controlvalidation_core.cpp	(revision 18027)
@@ -34,6 +34,6 @@
 
 	/*Allocate Gradient and current vector*/
-	G = xNew<double>(n);
-	X = xNew<double>(n);
+	G = xNew<IssmDouble>(n);
+	X = xNew<IssmDouble>(n);
 
 	/*out of solution_type, figure out solution core and adjoint function pointer*/
@@ -55,5 +55,5 @@
 	IssmDouble incr = -0.2;
 	IssmDouble exp1 = -8.;
-	int        num  = int((exp1-exp0)/incr);
+	int        num  = reCast<int>((exp1-exp0)/incr);
 
 	/*Allocate output*/
@@ -92,3 +92,5 @@
 	/*Clean up and return*/
 	xDelete<IssmDouble>(G);
+	xDelete<IssmDouble>(X);
+	xDelete<IssmDouble>(X0);
 }
