Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 12237)
+++ trunk/ippTools/src/chiptool.c	(revision 13580)
@@ -24,5 +24,7 @@
 #include <stdio.h>
 #include <string.h>
+#include <stdint.h>
 #include <stdlib.h>
+#include <math.h>
 
 #include "pxtools.h"
@@ -599,7 +601,11 @@
 
     bool status = false;
-    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
+    psS16 code = psMetadataLookupS16(&status, config->args, "-code");
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
+        return false;
+    }
+    if (code == INT16_MAX) {
+        psError(PS_ERR_UNKNOWN, true, "-code is required");
         return false;
     }
@@ -831,8 +837,4 @@
         return false;
     }
-    if (!uri) {
-        psError(PS_ERR_UNKNOWN, true, "-uri is required");
-        return false;
-    }
 
     psF64 bg = psMetadataLookupF64(&status, config->args, "-bg");
@@ -862,5 +864,5 @@
 
     // default values
-    psS8 code = psMetadataLookupS8(&status, config->args, "-code");
+    psS16 code = psMetadataLookupS16(&status, config->args, "-code");
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code");
