Index: /issm/trunk-jpl/src/m/coordsystems/gmtmask.m
===================================================================
--- /issm/trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 19287)
+++ /issm/trunk-jpl/src/m/coordsystems/gmtmask.m	(revision 19288)
@@ -15,5 +15,4 @@
 		dyld_library_path_old=getenv('DYLD_LIBRARY_PATH');
 		setenv('DYLD_LIBRARY_PATH',[ issmdir '/externalpackages/curl/install/lib:' issmdir '/externalpackages/hdf5/install/lib:' issmdir '/externalpackages/netcdf/install/lib' ]);
-		setenv('DYLD_LIBRARY_PATH',dyld_library_path_old);
 	end
 
@@ -21,4 +20,8 @@
 	system('gmt gmtselect ./all_vertices.txt -h0 -Df -R0/360/-90/90  -A0 -JQ180/200 -Nk/s/k/s/k > ./oce_vertices.txt');
 
+	%reset DYLD_LIBRARY_PATH to what it was: 
+	if ismac,
+		setenv('DYLD_LIBRARY_PATH',dyld_library_path_old);
+	end
 	%read the con_vertices.txt file and flag our mesh vertices on the continent
 	fid=fopen('./oce_vertices.txt','r');
Index: /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m
===================================================================
--- /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 19287)
+++ /issm/trunk-jpl/src/m/mesh/planet/gmsh/gmshplanet.m	(revision 19288)
@@ -29,7 +29,9 @@
 	fid=fopen('sphere.geo','w');
 
-	fprintf(fid,'Mesh.Algorithm = 7;\n');
+	fprintf(fid,'Mesh.Algorithm = 1;\n');
 	if  exist(options,'refine'),
+		fprintf(fid,'Mesh.Algorithm = 7;\n');
 		fprintf(fid,'Mesh.CharacteristicLengthFromPoints= 0;\n');
+		fprintf(fid,'Mesh.SmoothRatio= 3;\n');
 		fprintf(fid,'Mesh.RemeshAlgorithm= 1;\n');
 	end
@@ -102,8 +104,8 @@
 	%call gmsh
 	if  exist(options,'refine'),
-		eval(['!gmsh -2 sphere.geo -bgm sphere.pos']);
+		eval(['!gmsh -tol 1e-8 -2 sphere.geo -bgm sphere.pos']);
 	else
 		%call gmsh
-		eval(['!gmsh -2 sphere.geo']);
+		eval(['!gmsh -tol 1e-8 -2 sphere.geo']);
 	end
 
@@ -161,5 +163,5 @@
 
 	%erase files: 
-	eval(['!rm sphere.geo sphere.msh sphere.pos']);
+	eval(['!rm -rf sphere.geo sphere.msh sphere.pos']);
 
 	%return mesh: 
