Index: issm/trunk-jpl/jenkins/linux64_ross_javascript
===================================================================
--- issm/trunk-jpl/jenkins/linux64_ross_javascript	(revision 24303)
+++ issm/trunk-jpl/jenkins/linux64_ross_javascript	(revision 24304)
@@ -5,15 +5,14 @@
 
 #ISSM CONFIGURATION
-ISSM_CONFIG='--prefix="$ISSM_DIR" \
+ISSM_CONFIG='\
+    --prefix="${ISSM_DIR}" \
     --disable-shared \
     --with-javascript \
-    --with-triangle-dir="$ISSM_DIR/externalpackages/triangle/install-javascript" \
-    --with-gsl-dir="$ISSM_DIR/externalpackages/gsl/install-javascript" \
     --without-Love \
     --without-kml \
     --without-kriging \
-    --with-cxxoptflags="-O2" \
-    CXXFLAGS="-O2" \
-    CFLAGS="-O2"'
+    --with-triangle-dir="${ISSM_DIR}/externalpackages/triangle/install-javascript" \
+    --with-gsl-dir="$ISSM_DIR/externalpackages/gsl/install-javascript"\
+'
 
 #PYTHON and MATLAB testing
@@ -21,4 +20,8 @@
 PYTHON_TEST=0
 JAVASCRIPT_TEST=1
+
+# Environment
+#export EMCC_DEBUG=1 # Uncomment to enable debugging
+export EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0" # Required after v1.38.14
 
 #-----------------------------------#
Index: issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.h
===================================================================
--- issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.h	(revision 24303)
+++ issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.h	(revision 24304)
@@ -22,5 +22,5 @@
 #include "../bindings.h"
 
-#undef __FUNCT__ 
+#undef __FUNCT__
 #define __FUNCT__  "BamgMesher"
 
@@ -49,9 +49,9 @@
 #define BAMGMESHIN VerticesSize_mesh_in, Vertices_mesh_in, EdgesSize_mesh_in, Edges_mesh_in, TrianglesSize_mesh_in, Triangles_mesh_in, CrackedEdgesSize_mesh_in, CrackedEdges_mesh_in, VerticesOnGeomEdgeSize_mesh_in, VerticesOnGeomEdge_mesh_in, VerticesOnGeomVertexSize_mesh_in, VerticesOnGeomVertex_mesh_in, EdgesOnGeomEdgeSize_mesh_in, EdgesOnGeomEdge_mesh_in, IssmSegmentsSize_mesh_in, IssmSegments_mesh_in
 #define BAMGGEOMIN VerticesSize_geom_in, Vertices_geom_in, EdgesSize_geom_in, Edges_geom_in, CornersSize_geom_in, Corners_geom_in, RequiredVerticesSize_geom_in, RequiredVertices_geom_in, RequiredEdgesSize_geom_in, RequiredEdges_geom_in, CrackedEdgesSize_geom_in, CrackedEdges_geom_in, SubDomainsSize_geom_in, SubDomains_geom_in
-#define BAMGOPTIONS anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, hminVerticesSize, hminVertices, hmaxVerticesSize, hmaxVertices, hVerticesSize, hVertices, metricSize, metric, fieldSize, field, errSize, err
+#define BAMGOPTIONS anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, hminVerticesSize, hminVertices, hmaxVerticesSize, hmaxVertices, hVerticesLength, hVertices, metricSize, metric, fieldSize, field, errSize, err
 /* serial output macros: */
 #define BAMGMESHOUT VerticesSize_mesh_out, Vertices_mesh_out, EdgesSize_mesh_out, Edges_mesh_out, TrianglesSize_mesh_out, Triangles_mesh_out, IssmEdgesSize_mesh_out, IssmEdges_mesh_out, IssmSegmentsSize_mesh_out, IssmSegments_mesh_out, VerticesOnGeomVertexSize_mesh_out, VerticesOnGeomVertex_mesh_out, VerticesOnGeomEdgeSize_mesh_out, VerticesOnGeomEdge_mesh_out, EdgesOnGeomEdgeSize_mesh_out, EdgesOnGeomEdge_mesh_out, SubDomainsSize_mesh_out, SubDomains_mesh_out, SubDomainsFromGeomSize_mesh_out, SubDomainsFromGeom_mesh_out, ElementConnectivitySize_mesh_out, ElementConnectivity_mesh_out, NodalConnectivitySize_mesh_out, NodalConnectivity_mesh_out, NodalElementConnectivitySize_mesh_out, NodalElementConnectivity_mesh_out, CrackedVerticesSize_mesh_out, CrackedVertices_mesh_out, CrackedEdgesSize_mesh_out, CrackedEdges_mesh_out, PreviousNumberingSize_mesh_out, PreviousNumbering_mesh_out
 #define BAMGGEOMOUT VerticesSize_geom_out, Vertices_geom_out, EdgesSize_geom_out, Edges_geom_out, CornersSize_geom_out, Corners_geom_out, RequiredVerticesSize_geom_out, RequiredVertices_geom_out, RequiredEdgesSize_geom_out, RequiredEdges_geom_out, CrackedEdgesSize_geom_out, CrackedEdges_geom_out, SubDomainsSize_geom_out, SubDomains_geom_out
-#define WRAPPER(modulename) extern "C" { int  BamgMesherModule(int** VerticesSize_mesh_out, double** Vertices_mesh_out, int** EdgesSize_mesh_out, double** Edges_mesh_out, int** TrianglesSize_mesh_out, double** Triangles_mesh_out, int** IssmEdgesSize_mesh_out, double** IssmEdges_mesh_out, int** IssmSegmentsSize_mesh_out, double** IssmSegments_mesh_out, int** VerticesOnGeomVertexSize_mesh_out, double** VerticesOnGeomVertex_mesh_out, int** VerticesOnGeomEdgeSize_mesh_out, double** VerticesOnGeomEdge_mesh_out, int** EdgesOnGeomEdgeSize_mesh_out, double** EdgesOnGeomEdge_mesh_out, int** SubDomainsSize_mesh_out, double** SubDomains_mesh_out, int** SubDomainsFromGeomSize_mesh_out, double** SubDomainsFromGeom_mesh_out, int** ElementConnectivitySize_mesh_out, double** ElementConnectivity_mesh_out, int** NodalConnectivitySize_mesh_out, double** NodalConnectivity_mesh_out, int** NodalElementConnectivitySize_mesh_out, double** NodalElementConnectivity_mesh_out, int** CrackedVerticesSize_mesh_out, double** CrackedVertices_mesh_out, int** CrackedEdgesSize_mesh_out, double** CrackedEdges_mesh_out, int** PreviousNumberingSize_mesh_out, double** PreviousNumbering_mesh_out, int** VerticesSize_geom_out, double** Vertices_geom_out, int** EdgesSize_geom_out, double** Edges_geom_out, int** CornersSize_geom_out, double** Corners_geom_out, int** RequiredVerticesSize_geom_out, double** RequiredVertices_geom_out, int** RequiredEdgesSize_geom_out, double** RequiredEdges_geom_out, int** CrackedEdgesSize_geom_out, double** CrackedEdges_geom_out, int** SubDomainsSize_geom_out, double** SubDomains_geom_out, int* VerticesSize_mesh_in, double* Vertices_mesh_in, int* EdgesSize_mesh_in, double* Edges_mesh_in, int* TrianglesSize_mesh_in, double* Triangles_mesh_in, int* CrackedEdgesSize_mesh_in, double* CrackedEdges_mesh_in, int* VerticesOnGeomEdgeSize_mesh_in, double* VerticesOnGeomEdge_mesh_in, int* VerticesOnGeomVertexSize_mesh_in, double* VerticesOnGeomVertex_mesh_in, int* EdgesOnGeomEdgeSize_mesh_in, double* EdgesOnGeomEdge_mesh_in, int* IssmSegmentsSize_mesh_in, double* IssmSegments_mesh_in, int* VerticesSize_geom_in, double* Vertices_geom_in, int* EdgesSize_geom_in, double* Edges_geom_in, int* CornersSize_geom_in, double* Corners_geom_in, int* RequiredVerticesSize_geom_in, double* RequiredVertices_geom_in, int* RequiredEdgesSize_geom_in, double* RequiredEdges_geom_in, int* CrackedEdgesSize_geom_in, double* CrackedEdges_geom_in, int* SubDomainsSize_geom_in, double* SubDomains_geom_in, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int* hVerticesSize, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err)
+#define WRAPPER(modulename) extern "C" { int  BamgMesherModule(int** VerticesSize_mesh_out, double** Vertices_mesh_out, int** EdgesSize_mesh_out, double** Edges_mesh_out, int** TrianglesSize_mesh_out, double** Triangles_mesh_out, int** IssmEdgesSize_mesh_out, double** IssmEdges_mesh_out, int** IssmSegmentsSize_mesh_out, double** IssmSegments_mesh_out, int** VerticesOnGeomVertexSize_mesh_out, double** VerticesOnGeomVertex_mesh_out, int** VerticesOnGeomEdgeSize_mesh_out, double** VerticesOnGeomEdge_mesh_out, int** EdgesOnGeomEdgeSize_mesh_out, double** EdgesOnGeomEdge_mesh_out, int** SubDomainsSize_mesh_out, double** SubDomains_mesh_out, int** SubDomainsFromGeomSize_mesh_out, double** SubDomainsFromGeom_mesh_out, int** ElementConnectivitySize_mesh_out, double** ElementConnectivity_mesh_out, int** NodalConnectivitySize_mesh_out, double** NodalConnectivity_mesh_out, int** NodalElementConnectivitySize_mesh_out, double** NodalElementConnectivity_mesh_out, int** CrackedVerticesSize_mesh_out, double** CrackedVertices_mesh_out, int** CrackedEdgesSize_mesh_out, double** CrackedEdges_mesh_out, int** PreviousNumberingSize_mesh_out, double** PreviousNumbering_mesh_out, int** VerticesSize_geom_out, double** Vertices_geom_out, int** EdgesSize_geom_out, double** Edges_geom_out, int** CornersSize_geom_out, double** Corners_geom_out, int** RequiredVerticesSize_geom_out, double** RequiredVertices_geom_out, int** RequiredEdgesSize_geom_out, double** RequiredEdges_geom_out, int** CrackedEdgesSize_geom_out, double** CrackedEdges_geom_out, int** SubDomainsSize_geom_out, double** SubDomains_geom_out, int* VerticesSize_mesh_in, double* Vertices_mesh_in, int* EdgesSize_mesh_in, double* Edges_mesh_in, int* TrianglesSize_mesh_in, double* Triangles_mesh_in, int* CrackedEdgesSize_mesh_in, double* CrackedEdges_mesh_in, int* VerticesOnGeomEdgeSize_mesh_in, double* VerticesOnGeomEdge_mesh_in, int* VerticesOnGeomVertexSize_mesh_in, double* VerticesOnGeomVertex_mesh_in, int* EdgesOnGeomEdgeSize_mesh_in, double* EdgesOnGeomEdge_mesh_in, int* IssmSegmentsSize_mesh_in, double* IssmSegments_mesh_in, int* VerticesSize_geom_in, double* Vertices_geom_in, int* EdgesSize_geom_in, double* Edges_geom_in, int* CornersSize_geom_in, double* Corners_geom_in, int* RequiredVerticesSize_geom_in, double* RequiredVertices_geom_in, int* RequiredEdgesSize_geom_in, double* RequiredEdges_geom_in, int* CrackedEdgesSize_geom_in, double* CrackedEdges_geom_in, int* SubDomainsSize_geom_in, double* SubDomains_geom_in, double anisomax, double cutoff, double coeff, double errg, double gradation, int Hessiantype, int maxnbv, double maxsubdiv, int Metrictype, int nbjacobi, int nbsmooth, double omega, double power, int verbose, int Crack, int KeepVertices, int splitcorners, double hmin, double hmax, int* hminVerticesSize, double* hminVertices, int* hmaxVerticesSize, double* hmaxVertices, int hVerticesLength, double* hVertices, int* metricSize, double* metric, int* fieldSize, double* field, int* errSize, double* err)
 
 #endif
Index: issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.js
===================================================================
--- issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.js	(revision 24303)
+++ issm/trunk-jpl/src/wrappers/BamgMesher/BamgMesher.js	(revision 24304)
@@ -1,26 +1,26 @@
 function doublesToHeap(array) {
-	var doubleArray = new Float64Array(array);
+    var doubleArray = new Float64Array(array);
     var numBytes = doubleArray.length * doubleArray.BYTES_PER_ELEMENT;
-	var doubleArrayPtr = Module._malloc(numBytes);
+    var doubleArrayPtr = Module._malloc(numBytes);
     var doubleArrayHeap = new Uint8Array(Module.HEAPU8.buffer, doubleArrayPtr, numBytes);
-	doubleArrayHeap.set(new Uint8Array(doubleArray.buffer));
+    doubleArrayHeap.set(new Uint8Array(doubleArray.buffer));
     return doubleArrayHeap.byteOffset;
 }
 function intsToHeap(array) {
-	var intArray = new Int32Array(array);
+    var intArray = new Int32Array(array);
     var numBytes = intArray.length * intArray.BYTES_PER_ELEMENT;
-	var intArrayPtr = Module._malloc(numBytes);
+    var intArrayPtr = Module._malloc(numBytes);
     var intArrayHeap = new Uint8Array(Module.HEAPU8.buffer, intArrayPtr, numBytes);
-	intArrayHeap.set(new Uint8Array(intArray.buffer));
+    intArrayHeap.set(new Uint8Array(intArray.buffer));
     return intArrayHeap.byteOffset;
 }
 function heapToDoubles(pptr, size) {
-	var ptr = Module.getValue(pptr,'i32');
-	var array = Module.HEAPF64.slice(ptr / 8, ptr / 8 + size[0] * size[1]);
-	return ListToMatrix(array, size[1]);
+    var ptr = Module.getValue(pptr,'i32');
+    var array = Module.HEAPF64.slice(ptr / 8, ptr / 8 + size[0] * size[1]);
+    return ListToMatrix(array, size[1]);
 }
 function heapToInts(pptr, nods) {
-	var ptr = Module.getValue(pptr,'i32');
-	return Module.HEAPU32.slice(ptr / 4, ptr / 4 + nods);
+    var ptr = Module.getValue(pptr,'i32');
+    return Module.HEAPU32.slice(ptr / 4, ptr / 4 + nods);
 }
 function size2d(array) {
@@ -40,19 +40,19 @@
 function BamgMesher(bamgmesh_in, bamggeom_in, bamgopts) {
 /*
-	   usage: var array = Triangle(domain,rifts,area);
-	      where: array is made of [index,x,y,segments,segmentmarkers]
-		  and index,x,y defines a triangulation, segments is an array made 
-	      of exterior segments to the mesh domain outline, segmentmarkers is an array 
-		  flagging each segment, domain a js array defining the domain outline  (sames for 
-		  rifts) and area is the maximum area desired for any element of the resulting mesh.
-
-		  Ok, for now, we are not dealing with rifts. Also, the domain is made of only one 
-		  profile, this to avoid passing a double** pointer to js. 
+       usage: var array = Triangle(domain,rifts,area);
+          where: array is made of [index,x,y,segments,segmentmarkers]
+          and index,x,y defines a triangulation, segments is an array made
+          of exterior segments to the mesh domain outline, segmentmarkers is an array
+          flagging each segment, domain a js array defining the domain outline  (sames for
+          rifts) and area is the maximum area desired for any element of the resulting mesh.
+
+          Ok, for now, we are not dealing with rifts. Also, the domain is made of only one
+          profile, this to avoid passing a double** pointer to js.
 */
 
-	//Dynamic allocations: {{{
-	//Retrieve domain arrays, and allocate on Module heap: 
+    //Dynamic allocations: {{{
+    //Retrieve domain arrays, and allocate on Module heap:
     //For each property, calculate the size and fill with 0 if the 2nd dimension is undefined, then use the int size array to init the double array.
-	//input
+    //input
     var pVerticesSize_mesh_in               = intsToHeap(size2d(bamgmesh_in.Vertices));
     var pVertices_mesh_in                   = doublesToHeap(Array.prototype.concat.apply([], bamgmesh_in.Vertices));
@@ -110,5 +110,5 @@
     var phmaxVerticesSize                   = intsToHeap(size2d(bamgopts.hmaxVertices));
     var phmaxVertices                       = doublesToHeap(Array.prototype.concat.apply([], bamgopts.hmaxVertices));
-    var phVerticesSize                      = intsToHeap(size2d(bamgopts.hVertices));
+    var hVerticesLength                     = bamgopts.hVerticesLength;
     var phVertices                          = doublesToHeap(Array.prototype.concat.apply([], bamgopts.hVertices));
     var pmetricSize                         = intsToHeap(size2d(bamgopts.metric));
@@ -118,106 +118,106 @@
     var perrSize                            = intsToHeap(size2d([[bamgopts.err]]));
     var perr                                = doublesToHeap(Array.prototype.concat.apply([], [[bamgopts.err]]));
-	
-	//output
-    var pVerticesSize_mesh_out                  = Module._malloc(4); 
-    var pVertices_mesh_out                      = Module._malloc(4); 
-    var pEdgesSize_mesh_out                     = Module._malloc(4); 
-    var pEdges_mesh_out                         = Module._malloc(4); 
-    var pTrianglesSize_mesh_out                 = Module._malloc(4); 
-    var pTriangles_mesh_out                     = Module._malloc(4); 
-    var pIssmEdgesSize_mesh_out                 = Module._malloc(4); 
-    var pIssmEdges_mesh_out                     = Module._malloc(4); 
-    var pIssmSegmentsSize_mesh_out              = Module._malloc(4); 
-    var pIssmSegments_mesh_out                  = Module._malloc(4); 
-    var pVerticesOnGeomVertexSize_mesh_out      = Module._malloc(4); 
-    var pVerticesOnGeomVertex_mesh_out          = Module._malloc(4); 
-    var pVerticesOnGeomEdgeSize_mesh_out        = Module._malloc(4); 
-    var pVerticesOnGeomEdge_mesh_out            = Module._malloc(4); 
-    var pEdgesOnGeomEdgeSize_mesh_out           = Module._malloc(4); 
-    var pEdgesOnGeomEdge_mesh_out               = Module._malloc(4); 
-    var pSubDomainsSize_mesh_out                = Module._malloc(4); 
-    var pSubDomains_mesh_out                    = Module._malloc(4); 
-    var pSubDomainsFromGeomSize_mesh_out        = Module._malloc(4); 
-    var pSubDomainsFromGeom_mesh_out            = Module._malloc(4); 
-    var pElementConnectivitySize_mesh_out       = Module._malloc(4); 
-    var pElementConnectivity_mesh_out           = Module._malloc(4); 
-    var pNodalConnectivitySize_mesh_out         = Module._malloc(4); 
-    var pNodalConnectivity_mesh_out             = Module._malloc(4); 
-    var pNodalElementConnectivitySize_mesh_out  = Module._malloc(4); 
-    var pNodalElementConnectivity_mesh_out      = Module._malloc(4); 
-    var pCrackedVerticesSize_mesh_out           = Module._malloc(4); 
-    var pCrackedVertices_mesh_out               = Module._malloc(4); 
-    var pCrackedEdgesSize_mesh_out              = Module._malloc(4); 
-    var pCrackedEdges_mesh_out                  = Module._malloc(4); 
-    var pPreviousNumberingSize_mesh_out         = Module._malloc(4); 
-    var pPreviousNumbering_mesh_out             = Module._malloc(4); 
-
-    var pVerticesSize_geom_out                  = Module._malloc(4); 
+
+    //output
+    var pVerticesSize_mesh_out                  = Module._malloc(4);
+    var pVertices_mesh_out                      = Module._malloc(4);
+    var pEdgesSize_mesh_out                     = Module._malloc(4);
+    var pEdges_mesh_out                         = Module._malloc(4);
+    var pTrianglesSize_mesh_out                 = Module._malloc(4);
+    var pTriangles_mesh_out                     = Module._malloc(4);
+    var pIssmEdgesSize_mesh_out                 = Module._malloc(4);
+    var pIssmEdges_mesh_out                     = Module._malloc(4);
+    var pIssmSegmentsSize_mesh_out              = Module._malloc(4);
+    var pIssmSegments_mesh_out                  = Module._malloc(4);
+    var pVerticesOnGeomVertexSize_mesh_out      = Module._malloc(4);
+    var pVerticesOnGeomVertex_mesh_out          = Module._malloc(4);
+    var pVerticesOnGeomEdgeSize_mesh_out        = Module._malloc(4);
+    var pVerticesOnGeomEdge_mesh_out            = Module._malloc(4);
+    var pEdgesOnGeomEdgeSize_mesh_out           = Module._malloc(4);
+    var pEdgesOnGeomEdge_mesh_out               = Module._malloc(4);
+    var pSubDomainsSize_mesh_out                = Module._malloc(4);
+    var pSubDomains_mesh_out                    = Module._malloc(4);
+    var pSubDomainsFromGeomSize_mesh_out        = Module._malloc(4);
+    var pSubDomainsFromGeom_mesh_out            = Module._malloc(4);
+    var pElementConnectivitySize_mesh_out       = Module._malloc(4);
+    var pElementConnectivity_mesh_out           = Module._malloc(4);
+    var pNodalConnectivitySize_mesh_out         = Module._malloc(4);
+    var pNodalConnectivity_mesh_out             = Module._malloc(4);
+    var pNodalElementConnectivitySize_mesh_out  = Module._malloc(4);
+    var pNodalElementConnectivity_mesh_out      = Module._malloc(4);
+    var pCrackedVerticesSize_mesh_out           = Module._malloc(4);
+    var pCrackedVertices_mesh_out               = Module._malloc(4);
+    var pCrackedEdgesSize_mesh_out              = Module._malloc(4);
+    var pCrackedEdges_mesh_out                  = Module._malloc(4);
+    var pPreviousNumberingSize_mesh_out         = Module._malloc(4);
+    var pPreviousNumbering_mesh_out             = Module._malloc(4);
+
+    var pVerticesSize_geom_out                  = Module._malloc(4);
     var pVertices_geom_out                      = Module._malloc(4);
-    var pEdgesSize_geom_out                     = Module._malloc(4); 
-    var pEdges_geom_out                         = Module._malloc(4); 
-    var pCornersSize_geom_out                   = Module._malloc(4); 
-    var pCorners_geom_out                       = Module._malloc(4); 
-    var pRequiredVerticesSize_geom_out          = Module._malloc(4); 
-    var pRequiredVertices_geom_out              = Module._malloc(4); 
-    var pRequiredEdgesSize_geom_out             = Module._malloc(4); 
-    var pRequiredEdges_geom_out                 = Module._malloc(4); 
-    var pCrackedEdgesSize_geom_out              = Module._malloc(4); 
-    var pCrackedEdges_geom_out                  = Module._malloc(4); 
-    var pSubDomainsSize_geom_out                = Module._malloc(4); 
-    var pSubDomains_geom_out                    = Module._malloc(4); 
-	//}}}
-
-	//Declare BamgMesher module: 
-	BamgMesherModule = Module.cwrap('BamgMesherModule', 'number',[
+    var pEdgesSize_geom_out                     = Module._malloc(4);
+    var pEdges_geom_out                         = Module._malloc(4);
+    var pCornersSize_geom_out                   = Module._malloc(4);
+    var pCorners_geom_out                       = Module._malloc(4);
+    var pRequiredVerticesSize_geom_out          = Module._malloc(4);
+    var pRequiredVertices_geom_out              = Module._malloc(4);
+    var pRequiredEdgesSize_geom_out             = Module._malloc(4);
+    var pRequiredEdges_geom_out                 = Module._malloc(4);
+    var pCrackedEdgesSize_geom_out              = Module._malloc(4);
+    var pCrackedEdges_geom_out                  = Module._malloc(4);
+    var pSubDomainsSize_geom_out                = Module._malloc(4);
+    var pSubDomains_geom_out                    = Module._malloc(4);
+    //}}}
+
+    //Declare BamgMesher module:
+    BamgMesherModule = Module.cwrap('BamgMesherModule', 'number',[
         'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
-        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
-        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
-        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 
+        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
+        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
+        'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number',
         'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number']);
-	
-	//Call BamgMesher module: 
-
-	BamgMesherModule(
+
+    //Call BamgMesher module:
+
+    BamgMesherModule(
         pVerticesSize_mesh_out, pVertices_mesh_out, pEdgesSize_mesh_out, pEdges_mesh_out, pTrianglesSize_mesh_out, pTriangles_mesh_out, pIssmEdgesSize_mesh_out, pIssmEdges_mesh_out, pIssmSegmentsSize_mesh_out, pIssmSegments_mesh_out, pVerticesOnGeomVertexSize_mesh_out, pVerticesOnGeomVertex_mesh_out, pVerticesOnGeomEdgeSize_mesh_out, pVerticesOnGeomEdge_mesh_out, pEdgesOnGeomEdgeSize_mesh_out, pEdgesOnGeomEdge_mesh_out, pSubDomainsSize_mesh_out, pSubDomains_mesh_out, pSubDomainsFromGeomSize_mesh_out, pSubDomainsFromGeom_mesh_out, pElementConnectivitySize_mesh_out, pElementConnectivity_mesh_out, pNodalConnectivitySize_mesh_out, pNodalConnectivity_mesh_out, pNodalElementConnectivitySize_mesh_out, pNodalElementConnectivity_mesh_out, pCrackedVerticesSize_mesh_out, pCrackedVertices_mesh_out, pCrackedEdgesSize_mesh_out, pCrackedEdges_mesh_out, pPreviousNumberingSize_mesh_out, pPreviousNumbering_mesh_out,
-        pVerticesSize_geom_out, pVertices_geom_out, pEdgesSize_geom_out, pEdges_geom_out, pCornersSize_geom_out, pCorners_geom_out, pRequiredVerticesSize_geom_out, pRequiredVertices_geom_out, pRequiredEdgesSize_geom_out, pRequiredEdges_geom_out, pCrackedEdgesSize_geom_out, pCrackedEdges_geom_out, pSubDomainsSize_geom_out, pSubDomains_geom_out, 
-        pVerticesSize_mesh_in, pVertices_mesh_in, pEdgesSize_mesh_in, pEdges_mesh_in, pTrianglesSize_mesh_in, pTriangles_mesh_in, pCrackedEdgesSize_mesh_in, pCrackedEdges_mesh_in, pVerticesOnGeomEdgeSize_mesh_in, pVerticesOnGeomEdge_mesh_in, pVerticesOnGeomVertexSize_mesh_in, pVerticesOnGeomVertex_mesh_in, pEdgesOnGeomEdgeSize_mesh_in, pEdgesOnGeomEdge_mesh_in, pIssmSegmentsSize_mesh_in, pIssmSegments_mesh_in, 
-        pVerticesSize_geom_in, pVertices_geom_in, pEdgesSize_geom_in, pEdges_geom_in, pCornersSize_geom_in, pCorners_geom_in, pRequiredVerticesSize_geom_in, pRequiredVertices_geom_in, pRequiredEdgesSize_geom_in, pRequiredEdges_geom_in, pCrackedEdgesSize_geom_in, pCrackedEdges_geom_in, pSubDomainsSize_geom_in, pSubDomains_geom_in, 
-        anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, phminVerticesSize, phminVertices, phmaxVerticesSize, phmaxVertices, phVerticesSize, phVertices, pmetricSize, pmetric, pfieldSize, pfield, perrSize, perr);
-	
-	/*Dynamic copying from heap: {{{*/
-	//recover mesh: 
+        pVerticesSize_geom_out, pVertices_geom_out, pEdgesSize_geom_out, pEdges_geom_out, pCornersSize_geom_out, pCorners_geom_out, pRequiredVerticesSize_geom_out, pRequiredVertices_geom_out, pRequiredEdgesSize_geom_out, pRequiredEdges_geom_out, pCrackedEdgesSize_geom_out, pCrackedEdges_geom_out, pSubDomainsSize_geom_out, pSubDomains_geom_out,
+        pVerticesSize_mesh_in, pVertices_mesh_in, pEdgesSize_mesh_in, pEdges_mesh_in, pTrianglesSize_mesh_in, pTriangles_mesh_in, pCrackedEdgesSize_mesh_in, pCrackedEdges_mesh_in, pVerticesOnGeomEdgeSize_mesh_in, pVerticesOnGeomEdge_mesh_in, pVerticesOnGeomVertexSize_mesh_in, pVerticesOnGeomVertex_mesh_in, pEdgesOnGeomEdgeSize_mesh_in, pEdgesOnGeomEdge_mesh_in, pIssmSegmentsSize_mesh_in, pIssmSegments_mesh_in,
+        pVerticesSize_geom_in, pVertices_geom_in, pEdgesSize_geom_in, pEdges_geom_in, pCornersSize_geom_in, pCorners_geom_in, pRequiredVerticesSize_geom_in, pRequiredVertices_geom_in, pRequiredEdgesSize_geom_in, pRequiredEdges_geom_in, pCrackedEdgesSize_geom_in, pCrackedEdges_geom_in, pSubDomainsSize_geom_in, pSubDomains_geom_in,
+        anisomax, cutoff, coeff, errg, gradation, Hessiantype, maxnbv, maxsubdiv, Metrictype, nbjacobi, nbsmooth, omega, power, verbose, Crack, KeepVertices, splitcorners, hmin, hmax, phminVerticesSize, phminVertices, phmaxVerticesSize, phmaxVertices, hVerticesLength, phVertices, pmetricSize, pmetric, pfieldSize, pfield, perrSize, perr);
+
+    /*Dynamic copying from heap: {{{*/
+    //recover mesh:
     var bamgmeshout = new bamgmesh();
     var bamggeomout = new bamggeom();
 
-	bamgmeshout.VerticesSize                   = heapToInts(pVerticesSize_mesh_out, 2);
+    bamgmeshout.VerticesSize                   = heapToInts(pVerticesSize_mesh_out, 2);
     bamgmeshout.Vertices                       = heapToDoubles(pVertices_mesh_out, bamgmeshout.VerticesSize);
-	bamgmeshout.EdgesSize                      = heapToInts(pEdgesSize_mesh_out, 2);
+    bamgmeshout.EdgesSize                      = heapToInts(pEdgesSize_mesh_out, 2);
     bamgmeshout.Edges                          = heapToDoubles(pEdges_mesh_out, bamgmeshout.EdgesSize);
-	bamgmeshout.TrianglesSize                  = heapToInts(pTrianglesSize_mesh_out, 2);
+    bamgmeshout.TrianglesSize                  = heapToInts(pTrianglesSize_mesh_out, 2);
     bamgmeshout.Triangles                      = heapToDoubles(pTriangles_mesh_out, bamgmeshout.TrianglesSize);
-	bamgmeshout.IssmEdgesSize                  = heapToInts(pIssmEdgesSize_mesh_out, 2);
+    bamgmeshout.IssmEdgesSize                  = heapToInts(pIssmEdgesSize_mesh_out, 2);
     bamgmeshout.IssmEdges                      = heapToDoubles(pIssmEdges_mesh_out, bamgmeshout.IssmEdgesSize);
-	bamgmeshout.IssmSegmentsSize               = heapToInts(pIssmSegmentsSize_mesh_out, 2);
+    bamgmeshout.IssmSegmentsSize               = heapToInts(pIssmSegmentsSize_mesh_out, 2);
     bamgmeshout.IssmSegments                   = heapToDoubles(pIssmSegments_mesh_out, bamgmeshout.IssmSegmentsSize);
-	bamgmeshout.VerticesOnGeomVertexSize       = heapToInts(pVerticesOnGeomVertexSize_mesh_out, 2);
+    bamgmeshout.VerticesOnGeomVertexSize       = heapToInts(pVerticesOnGeomVertexSize_mesh_out, 2);
     bamgmeshout.VerticesOnGeomVertex           = heapToDoubles(pVerticesOnGeomVertex_mesh_out, bamgmeshout.VerticesOnGeomVertexSize);
-	bamgmeshout.VerticesOnGeomEdgeSize         = heapToInts(pVerticesOnGeomEdgeSize_mesh_out, 2);
+    bamgmeshout.VerticesOnGeomEdgeSize         = heapToInts(pVerticesOnGeomEdgeSize_mesh_out, 2);
     bamgmeshout.VerticesOnGeomEdge             = heapToDoubles(pVerticesOnGeomEdge_mesh_out, bamgmeshout.VerticesOnGeomEdgeSize);
-	bamgmeshout.EdgesOnGeomEdgeSize            = heapToInts(pEdgesOnGeomEdgeSize_mesh_out, 2);
+    bamgmeshout.EdgesOnGeomEdgeSize            = heapToInts(pEdgesOnGeomEdgeSize_mesh_out, 2);
     bamgmeshout.EdgesOnGeomEdge                = heapToDoubles(pEdgesOnGeomEdge_mesh_out, bamgmeshout.EdgesOnGeomEdgeSize);
-	bamgmeshout.SubDomainsSize                 = heapToInts(pSubDomainsSize_mesh_out, 2);
+    bamgmeshout.SubDomainsSize                 = heapToInts(pSubDomainsSize_mesh_out, 2);
     bamgmeshout.SubDomains                     = heapToDoubles(pSubDomains_mesh_out, bamgmeshout.SubDomainsSize);
-	bamgmeshout.SubDomainsFromGeomSize         = heapToInts(pSubDomainsFromGeomSize_mesh_out, 2);
+    bamgmeshout.SubDomainsFromGeomSize         = heapToInts(pSubDomainsFromGeomSize_mesh_out, 2);
     bamgmeshout.SubDomainsFromGeom             = heapToDoubles(pSubDomainsFromGeom_mesh_out, bamgmeshout.SubDomainsFromGeomSize);
-	bamgmeshout.ElementConnectivitySize        = heapToInts(pElementConnectivitySize_mesh_out, 2);
+    bamgmeshout.ElementConnectivitySize        = heapToInts(pElementConnectivitySize_mesh_out, 2);
     bamgmeshout.ElementConnectivity            = heapToDoubles(pElementConnectivity_mesh_out, bamgmeshout.ElementConnectivitySize);
-	bamgmeshout.NodalConnectivitySize          = heapToInts(pNodalConnectivitySize_mesh_out, 2);
+    bamgmeshout.NodalConnectivitySize          = heapToInts(pNodalConnectivitySize_mesh_out, 2);
     bamgmeshout.NodalConnectivity              = heapToDoubles(pNodalConnectivity_mesh_out, bamgmeshout.NodalConnectivitySize);
-	bamgmeshout.NodalElementConnectivitySize   = heapToInts(pNodalElementConnectivitySize_mesh_out, 2);
+    bamgmeshout.NodalElementConnectivitySize   = heapToInts(pNodalElementConnectivitySize_mesh_out, 2);
     bamgmeshout.NodalElementConnectivity       = heapToDoubles(pNodalElementConnectivity_mesh_out, bamgmeshout.NodalElementConnectivitySize);
-	bamgmeshout.CrackedVerticesSize            = heapToInts(pCrackedVerticesSize_mesh_out, 2);
+    bamgmeshout.CrackedVerticesSize            = heapToInts(pCrackedVerticesSize_mesh_out, 2);
     bamgmeshout.CrackedVertices                = heapToDoubles(pCrackedVertices_mesh_out, bamgmeshout.CrackedVerticesSize);
-	bamgmeshout.CrackedEdgesSize               = heapToInts(pCrackedEdgesSize_mesh_out, 2);
+    bamgmeshout.CrackedEdgesSize               = heapToInts(pCrackedEdgesSize_mesh_out, 2);
     bamgmeshout.CrackedEdges                   = heapToDoubles(pCrackedEdges_mesh_out, bamgmeshout.CrackedEdgesSize);
     bamgmeshout.PreviousNumberingSize          = heapToInts(pPreviousNumberingSize_mesh_out, 2);
@@ -238,41 +238,41 @@
     bamggeomout.SubDomainsSize                 = heapToInts(pSubDomainsSize_geom_out, 2);
     bamggeomout.SubDomains                     = heapToDoubles(pSubDomains_geom_out, bamggeomout.SubDomainsSize);
-	/*}}}*/
-
-	var return_array=[bamgmeshout, bamggeomout];
-
-	/*Free ressources: */
-    Module._free(pVerticesSize_mesh_out); 
-    Module._free(pVertices_mesh_out); 
-    Module._free(pEdgesSize_mesh_out); 
-    Module._free(pEdges_mesh_out); 
-    Module._free(pTrianglesSize_mesh_out); 
-    Module._free(pTriangles_mesh_out); 
-    Module._free(pIssmEdgesSize_mesh_out); 
-    Module._free(pIssmEdges_mesh_out); 
-    Module._free(pIssmSegmentsSize_mesh_out); 
-    Module._free(pIssmSegments_mesh_out); 
-    Module._free(pVerticesOnGeomVertexSize_mesh_out); 
-    Module._free(pVerticesOnGeomVertex_mesh_out); 
-    Module._free(pVerticesOnGeomEdgeSize_mesh_out); 
-    Module._free(pVerticesOnGeomEdge_mesh_out); 
-    Module._free(pEdgesOnGeomEdgeSize_mesh_out); 
-    Module._free(pEdgesOnGeomEdge_mesh_out); 
-    Module._free(pSubDomainsSize_mesh_out); 
-    Module._free(pSubDomains_mesh_out); 
-    Module._free(pSubDomainsFromGeomSize_mesh_out); 
-    Module._free(pSubDomainsFromGeom_mesh_out); 
-    Module._free(pElementConnectivitySize_mesh_out); 
-    Module._free(pElementConnectivity_mesh_out); 
-    Module._free(pNodalConnectivitySize_mesh_out); 
-    Module._free(pNodalConnectivity_mesh_out); 
-    Module._free(pNodalElementConnectivitySize_mesh_out); 
-    Module._free(pNodalElementConnectivity_mesh_out); 
-    Module._free(pCrackedVerticesSize_mesh_out); 
-    Module._free(pCrackedVertices_mesh_out); 
-    Module._free(pCrackedEdgesSize_mesh_out); 
-    Module._free(pCrackedEdges_mesh_out); 
-    Module._free(pPreviousNumberingSize_mesh_out); 
-    Module._free(pPreviousNumbering_mesh_out); 
+    /*}}}*/
+
+    var return_array=[bamgmeshout, bamggeomout];
+
+    /*Free ressources: */
+    Module._free(pVerticesSize_mesh_out);
+    Module._free(pVertices_mesh_out);
+    Module._free(pEdgesSize_mesh_out);
+    Module._free(pEdges_mesh_out);
+    Module._free(pTrianglesSize_mesh_out);
+    Module._free(pTriangles_mesh_out);
+    Module._free(pIssmEdgesSize_mesh_out);
+    Module._free(pIssmEdges_mesh_out);
+    Module._free(pIssmSegmentsSize_mesh_out);
+    Module._free(pIssmSegments_mesh_out);
+    Module._free(pVerticesOnGeomVertexSize_mesh_out);
+    Module._free(pVerticesOnGeomVertex_mesh_out);
+    Module._free(pVerticesOnGeomEdgeSize_mesh_out);
+    Module._free(pVerticesOnGeomEdge_mesh_out);
+    Module._free(pEdgesOnGeomEdgeSize_mesh_out);
+    Module._free(pEdgesOnGeomEdge_mesh_out);
+    Module._free(pSubDomainsSize_mesh_out);
+    Module._free(pSubDomains_mesh_out);
+    Module._free(pSubDomainsFromGeomSize_mesh_out);
+    Module._free(pSubDomainsFromGeom_mesh_out);
+    Module._free(pElementConnectivitySize_mesh_out);
+    Module._free(pElementConnectivity_mesh_out);
+    Module._free(pNodalConnectivitySize_mesh_out);
+    Module._free(pNodalConnectivity_mesh_out);
+    Module._free(pNodalElementConnectivitySize_mesh_out);
+    Module._free(pNodalElementConnectivity_mesh_out);
+    Module._free(pCrackedVerticesSize_mesh_out);
+    Module._free(pCrackedVertices_mesh_out);
+    Module._free(pCrackedEdgesSize_mesh_out);
+    Module._free(pCrackedEdges_mesh_out);
+    Module._free(pPreviousNumberingSize_mesh_out);
+    Module._free(pPreviousNumbering_mesh_out);
 
     Module._free(pVerticesSize_geom_out);
@@ -327,5 +327,4 @@
     Module._free(phmaxVerticesSize);
     Module._free(phmaxVertices);
-    Module._free(phVerticesSize);
     Module._free(phVertices);
     Module._free(pmetricSize);
@@ -336,4 +335,4 @@
     Module._free(perr);
 
-	return return_array;
-}
+    return return_array;
+}
Index: issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp
===================================================================
--- issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp	(revision 24303)
+++ issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp	(revision 24304)
@@ -15,26 +15,23 @@
 /*FUNCTION FetchData(char** pstring, char* string){{{*/
 void FetchData(char** pstring, char* stringin){
-
-	char* string=xNew<char>(strlen(stringin)+1);
-	xMemCpy<char>(string,stringin,strlen(stringin)+1);
+	char* string=NULL;
+
+	string=xNew<char>(strlen(stringin)+1); xMemCpy<char>(string,stringin,strlen(stringin)+1);
 
 	*pstring=string;
 }
 /*}}}*/
-/*FUNCTION FetchData(int* pinteger,int integer){{{*/
-void FetchData(int* pinteger,int integer){
-
-	*pinteger = integer;
-}
-/*}}}*/
-/*FUNCTION FetchData(double* pscalar,double scalar){{{*/
-void FetchData(double* pscalar,double scalar){
-
-	*pscalar = scalar;
+/*FUNCTION FetchData(int* pinteger, int integer){{{*/
+void FetchData(int* pinteger, int integer){
+	*pinteger=integer;
+}
+/*}}}*/
+/*FUNCTION FetchData(double* pscalar, double scalar){{{*/
+void FetchData(double* pscalar, double scalar){
+	*pscalar=scalar;
 }
 /*}}}*/
 /*FUNCTION FetchData(double **pvector, double* vectorin, int nods){{{*/
 void FetchData(double** pvector, double* vectorin, int nods){
-
 	double* vector=NULL;
 
@@ -46,5 +43,4 @@
 /*FUNCTION FetchData(double **pvector, int* pnods, double* vectorin, int nods){{{*/
 void FetchData(double** pvector, int* pnods, double* vectorin, int nods){
-
 	double* vector=NULL;
 
@@ -57,7 +53,6 @@
 /*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, int* matrix, int M, int N){{{*/
 void FetchData(double **pmatrix, int* pM, int* pN, int* matrixin, int M, int N){
-
 	double*  outmatrix=NULL;
-	int      outmatrix_rows,outmatrix_cols;
+	int      outmatrix_rows, outmatrix_cols;
 
 	if(M == 0 || N == 0){
@@ -71,18 +66,17 @@
 		outmatrix_cols=N;
 		outmatrix=xNew<IssmPDouble>(M*N);
-		for(int i=0;i<M*N;i++)outmatrix[i]=(IssmPDouble)matrixin[i];
+		for(int i=0;i<M*N;i++){outmatrix[i]=(IssmPDouble)matrixin[i];}
 	}
 
 	/*Assign output pointers:*/
 	*pmatrix=outmatrix;
-	if (pM)*pM=outmatrix_rows;
-	if (pN)*pN=outmatrix_cols;
+	if (pM){*pM=outmatrix_rows;}
+	if (pN){*pN=outmatrix_cols;}
 }
 /*}}}*/
 /*FUNCTION FetchData(double **pmatrix, int* pM, int* pN, double* matrix, int M, int N){{{*/
 void FetchData(double **pmatrix, int* pM, int* pN, double* matrixin, int M, int N){
-
 	double*  outmatrix=NULL;
-	int      outmatrix_rows,outmatrix_cols;
+	int      outmatrix_rows, outmatrix_cols;
 
 	if(M == 0 || N == 0){
@@ -100,13 +94,12 @@
 	/*Assign output pointers:*/
 	*pmatrix=outmatrix;
-	if (pM)*pM=outmatrix_rows;
-	if (pN)*pN=outmatrix_cols;
+	if (pM){*pM=outmatrix_rows;}
+	if (pN){*pN=outmatrix_cols;}
 }
 /*}}}*/
 /*FUNCTION FetchData(int **pmatrix, int* pM, int* pN, int* matrix, int M, int N){{{*/
 void FetchData(int **pmatrix, int* pM, int* pN, int* matrixin, int M, int N){
-
 	int*     outmatrix=NULL;
-	int      outmatrix_rows,outmatrix_cols;
+	int      outmatrix_rows, outmatrix_cols;
 
 	if(M == 0 || N == 0){
@@ -124,13 +117,12 @@
 	/*Assign output pointers:*/
 	*pmatrix=outmatrix;
-	if (pM)*pM=outmatrix_rows;
-	if (pN)*pN=outmatrix_cols;
+	if (pM){*pM=outmatrix_rows;}
+	if (pN){*pN=outmatrix_cols;}
 }
 /*}}}*/
 /*ISSM objects*/
-/*FUNCTION FetchData(Contours** pcontours,double* x, double* y, int nods){{{*/
-void FetchData(Contours** pcontours,double* x, double* y, int nods){
-
-	int             numcontours,index,test1,test2;
+/*FUNCTION FetchData(Contours** pcontours, double* x, double* y, int nods){{{*/
+void FetchData(Contours** pcontours, double* x, double* y, int nods){
+	int             numcontours, index, test1, test2;
 	char            *contourname = NULL;
 	Contours        *contours    = NULL;
@@ -141,10 +133,8 @@
 
 	if (nods){
-
 		contouri=new Contour<double>();
 		contouri->nods=nods;
 		contouri->x=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(contouri->x,x,nods);
 		contouri->y=xNew<IssmPDouble>(nods); xMemCpy<IssmPDouble>(contouri->y,y,nods);
-
 		contours->AddObject(contouri);
 	}
@@ -157,5 +147,5 @@
 
 	/*Initialize output*/
-	BamgGeom* bamggeom = new BamgGeom();
+	BamgGeom* bamggeom=new BamgGeom();
 
 	/*Fetch all fields*/
@@ -169,5 +159,5 @@
 
 	/*Assign output pointers:*/
-	*pbamggeom = bamggeom;
+	*pbamggeom=bamggeom;
 }
 /*}}}*/
@@ -176,5 +166,5 @@
 
 	/*Initialize output*/
-	BamgMesh* bamgmesh = new BamgMesh();
+	BamgMesh* bamgmesh=new BamgMesh();
 
 	/*Fetch all fields*/
@@ -189,5 +179,5 @@
 
 	/*Assign output pointers:*/
-	*pbamgmesh = bamgmesh;
+	*pbamgmesh=bamgmesh;
 }
 /*}}}*/
@@ -232,9 +222,9 @@
 
 	/*Assign output pointers:*/
-	*pbamgopts              = bamgopts;
-}
-/*}}}*/
-/*FUNCTION FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){{{*/
-void FetchData(Options** poptions,int NRHS, int nrhs, const char* optionname, double optionvalue){
+	*pbamgopts=bamgopts;
+}
+/*}}}*/
+/*FUNCTION FetchData(Options** poptions, int NRHS, int nrhs, const char* optionname, double optionvalue){{{*/
+void FetchData(Options** poptions, int NRHS, int nrhs, const char* optionname, double optionvalue){
 
 	/*Initialize output*/
@@ -242,7 +232,7 @@
 
 	/*check and parse the name  */
-	GenericOption<double> *odouble = new GenericOption<double>();
+	GenericOption<double> *odouble=new GenericOption<double>();
 	odouble=new GenericOption<double>();
-	odouble->name =xNew<char>(strlen(optionname)+1);
+	odouble->name=xNew<char>(strlen(optionname)+1);
 	memcpy(odouble->name,optionname,(strlen(optionname)+1)*sizeof(char));
 	odouble->value=optionvalue;
