fix NPE
diff --git a/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java b/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java
index 5734b5a..35b510d 100644
--- a/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java
+++ b/genomix/genomix-driver/src/main/java/edu/uci/ics/genomix/driver/GenomixDriver.java
@@ -103,6 +103,8 @@
     }
 
     private void shutdownNCs() throws IOException {
+        if (curNC == null) // nothing started yet
+            return;
         switch(curNC) {
             case HYRACKS:
             case PREGELIX:
@@ -115,8 +117,8 @@
                 }
                 curNC = null;
                 break;
-            default: // nothing started yet
-                break;
+            default:
+                throw new IllegalArgumentException("Invalid type specified for curNC: " + curNC);
         }
     }
 
diff --git a/genomix/genomix-driver/src/main/resources/scripts/startDebugNc.sh b/genomix/genomix-driver/src/main/resources/scripts/startDebugNc.sh
index 0601787..8ae2722 100644
--- a/genomix/genomix-driver/src/main/resources/scripts/startDebugNc.sh
+++ b/genomix/genomix-driver/src/main/resources/scripts/startDebugNc.sh
@@ -50,9 +50,9 @@
 cd $NCTMP_DIR2
 
 
-if [ "$1" == "hyracks" ]; then
+if [ "$1" == "HYRACKS" ]; then
   NCTYPE="hyracksnc"
-elif [ "$1" == "pregelix" ]; then
+elif [ "$1" == "PREGELIX" ]; then
   NCTYPE="pregelixnc"
 else
   echo "unknown NC type $1" 1>&2
diff --git a/genomix/genomix-driver/src/main/resources/scripts/startnc.sh b/genomix/genomix-driver/src/main/resources/scripts/startnc.sh
index 4012c0c..d98df2b 100644
--- a/genomix/genomix-driver/src/main/resources/scripts/startnc.sh
+++ b/genomix/genomix-driver/src/main/resources/scripts/startnc.sh
@@ -50,9 +50,9 @@
 #Enter the temp dir
 cd $NCTMP_DIR
 
-if [ "$1" == "hyracks" ]; then
+if [ "$1" == "HYRACKS" ]; then
   NCTYPE="hyracksnc"
-elif [ "$1" == "pregelix" ]; then
+elif [ "$1" == "PREGELIX" ]; then
   NCTYPE="pregelixnc"
 else
   echo "unknown NC type $1" 1>&2
diff --git a/genomix/genomix-driver/src/main/resources/scripts/stopnc.sh b/genomix/genomix-driver/src/main/resources/scripts/stopnc.sh
index c5c5e40..ee53699 100644
--- a/genomix/genomix-driver/src/main/resources/scripts/stopnc.sh
+++ b/genomix/genomix-driver/src/main/resources/scripts/stopnc.sh
@@ -8,9 +8,9 @@
 . conf/cluster.properties
 
 
-if [ "$1" == "hyracks" ]; then
+if [ "$1" == "HYRACKS" ]; then
   NCTYPE="hyracksnc"
-elif [ "$1" == "pregelix" ]; then
+elif [ "$1" == "PREGELIX" ]; then
   NCTYPE="pregelixnc"
 else
   echo "unknown NC type $1" 1>&2