Index: /issm/trunk/src/mex/KMLMeshWrite/KMLMeshWrite.cpp
===================================================================
--- /issm/trunk/src/mex/KMLMeshWrite/KMLMeshWrite.cpp	(revision 7660)
+++ /issm/trunk/src/mex/KMLMeshWrite/KMLMeshWrite.cpp	(revision 7661)
@@ -110,10 +110,7 @@
 	if (verbose) printf("Checking inputs:\n");
 
-	if (nodecon)
-		nnodes=mncon;
-	else
-		for (i=0; i<melem*nelem; i++)
-			if (elem[i] > nnodes)
-				nnodes=elem[i];
+	for (i=0; i<melem*nelem; i++)
+		if (elem[i] > nnodes)
+			nnodes=elem[i];
 	if (verbose) printf("  nnodes =%d\n",nnodes);
 	if (part)
@@ -123,4 +120,8 @@
 	if (verbose) printf("  nparts =%d\n",nparts);
 
+	if      (nodecon && (mncon != nnodes))
+		_error_("Nodal connectivity table, if supplied, must be supplied for all nodes.");
+	else if (!nodecon)
+		mncon=nnodes;
 	if ((llat != nnodes) || (llng != nnodes) || (llat != llng))
 		_error_("Latitude and longitude vectors must be supplied for all nodes.");
@@ -128,7 +129,7 @@
 		_error_("Partitioning vector, if supplied, must be supplied for all nodes.");
 	if (data && !((mdata == nnodes) || (mdata == melem)))
-		_error_("Data vector, if supplied, must be supplied for all nodes or all elements.");
+		_error_("Data matrix, if supplied, must be supplied for all nodes or all elements.");
 	if (cmap && (ncmap != 3))
-		_error_("Colormap vector, if supplied, must have three columns for rgb.");
+		_error_("Colormap matrix, if supplied, must have three columns for rgb.");
 
 	if (!strlen(filnam))
