diff --git a/js/tools/build/ndn-js-uncomp.js b/js/tools/build/ndn-js-uncomp.js
index e215bdb..124b05e 100644
--- a/js/tools/build/ndn-js-uncomp.js
+++ b/js/tools/build/ndn-js-uncomp.js
@@ -144,8 +144,8 @@
 				var interest = new Interest();
 				interest.from_ccnb(decoder);
 				if (LOG > 3) console.log(interest);
-				//var nameStr = escape(interest.name.getName());
-				//console.log(nameStr);
+				var nameStr = escape(interest.name.getName());
+				if (LOG > 3) console.log(nameStr);
 				
 				var entry = getEntryForRegisteredPrefix(nameStr);
 				if (entry != null) {
@@ -173,14 +173,9 @@
 				
 				var co = new ContentObject();
 				co.from_ccnb(decoder);
-				if (LOG > 3) console.log(co);
+				//console.log(co);
 				//var nameStr = co.name.getName();
 				//console.log(nameStr);
-				var wit = null;
-				if (co.signature.Witness != null) {
-					wit = new Witness();
-					wit.decode(co.signature.Witness);
-				}
 				
 				if (self.ccndid == null && NDN.ccndIdFetcher.match(co.name)) {
 					// We are in starting phase, record publisherPublicKeyDigest in self.ccndid
@@ -236,7 +231,7 @@
 								console.log("In KeyFetchClosure.upcall: interest time out.");
 								console.log(this.keyName.contentName.getName());
 							} else if (kind == Closure.UPCALL_CONTENT) {
-								if (LOG > 3) console.log("In KeyFetchClosure.upcall: signature verification passed");
+								//console.log("In KeyFetchClosure.upcall: signature verification passed");
 								
 								var rsakey = decodeSubjectPublicKeyInfo(upcallInfo.contentObject.content);
 								var verified = rsakey.verifyByteArray(this.contentObject.rawSignatureData, this.witness, this.sigHex);
@@ -249,6 +244,8 @@
 								var keyEntry = new KeyStoreEntry(keylocator.keyName, rsakey, new Date().getTime());
 								NDN.addKeyEntry(keyEntry);
 								//console.log(NDN.KeyStore);
+							} else if (kind == Closure.UPCALL_CONTENT_BAD) {
+								console.log("In KeyFetchClosure.upcall: signature verification failed");
 							}
 						};
 						
@@ -256,6 +253,12 @@
 							if (LOG > 3) console.log("Key verification...");
 							var sigHex = DataUtils.toHex(co.signature.signature).toLowerCase();
 							
+							var wit = null;
+							if (co.signature.Witness != null) {
+								wit = new Witness();
+								wit.decode(co.signature.Witness);
+							}
+							
 							var keylocator = co.signedInfo.locator;
 							if (keylocator.type == KeyLocatorType.KEYNAME) {
 								if (LOG > 3) console.log("KeyLocator contains KEYNAME");
@@ -300,14 +303,9 @@
 								}
 							} else if (keylocator.type == KeyLocatorType.KEY) {
 								if (LOG > 3) console.log("Keylocator contains KEY");
-								var verified = false;
 								
-								if (wit == null) {
-									var rsakey = decodeSubjectPublicKeyInfo(co.signedInfo.locator.publicKey);
-									verified = rsakey.verifyByteArray(co.rawSignatureData, wit, sigHex);
-								} else {
-									
-								}
+								var rsakey = decodeSubjectPublicKeyInfo(co.signedInfo.locator.publicKey);
+								var verified = rsakey.verifyByteArray(co.rawSignatureData, wit, sigHex);
 								
 								var flag = (verified == true) ? Closure.UPCALL_CONTENT : Closure.UPCALL_CONTENT_BAD;
 								// Raise callback
@@ -1062,7 +1060,7 @@
 	this.startSIG = null;
 	this.endSIG = null;
 	
-	this.startSignedInfo = null;
+	//this.startSignedInfo = null;
 	this.endContent = null;
 	
 	this.rawSignatureData = null;
@@ -4410,7 +4408,7 @@
 	    output += "exponent: " + x509.subjectPublicKeyRSA.e.toString(16) + "<br/>";
 	    output += "<br/>";
 	    
-	    var result = x509.subjectPublicKeyRSA.verifyByteArray(co.rawSignatureData, signature);
+	    var result = x509.subjectPublicKeyRSA.verifyByteArray(co.rawSignatureData, null, signature);
 	    if(LOG>2) console.log('result is '+result);
 	    
 	    var n = x509.subjectPublicKeyRSA.n;
@@ -4440,6 +4438,14 @@
 	    var signature = DataUtils.toHex(co.signature.signature).toLowerCase();
 	    var input = DataUtils.toString(co.rawSignatureData);
 	    
+	    var wit = null;
+	    var witHex = "";
+		if (co.signature.Witness != null) {
+			wit = new Witness();
+			wit.decode(co.signature.Witness);
+			witHex = DataUtils.toHex(co.signature.Witness);
+		}
+	    
 	    output += "Public key: " + publickeyHex;
 	    
 	    output+= "<br />";
@@ -4450,6 +4456,7 @@
 	    if(LOG>2) console.log(" PublicKeyString = "+publickeyString );
 	    
 	    if(LOG>2) console.log(" Signature "+signature );
+	    if(LOG>2) console.log(" Witness "+witHex );
 	    
 	    if(LOG>2) console.log(" Signature NOW IS" );
 	    
@@ -4461,7 +4468,7 @@
 	    output += "exponent: " + rsakey.e.toString(16) + "<br/>";
 	    output += "<br/>";
 	   	    
-	    var result = rsakey.verifyByteArray(co.rawSignatureData,signature);
+	    var result = rsakey.verifyByteArray(co.rawSignatureData, wit, signature);
 	    // var result = rsakey.verifyString(input, signature);
 	    
 	    if(LOG>2) console.log('PUBLIC KEY n after is ');
@@ -4471,9 +4478,9 @@
 	    if(LOG>2) console.log(rsakey.e);
 	    
 	    if(result)
-		output += 'SIGNATURE VALID';
+			output += 'SIGNATURE VALID';
 	    else
-		output += 'SIGNATURE INVALID';
+			output += 'SIGNATURE INVALID';
 	    
 	    //output += "VALID: "+ toHex(co.signedInfo.locator.publicKey);
 	    
