diff --git a/js/tools/build/ndn-js-uncomp.js b/js/tools/build/ndn-js-uncomp.js
index 6f3a295..e4117eb 100644
--- a/js/tools/build/ndn-js-uncomp.js
+++ b/js/tools/build/ndn-js-uncomp.js
@@ -297,7 +297,7 @@
 										if (LOG > 3) console.log("Fetch key according to keylocator");
 										var nextClosure = new KeyFetchClosure(co, currentClosure, keylocator.keyName, sigHex, wit);
 										var interest = new Interest(keylocator.keyName.contentName.getPrefix(4));
-										interest.interestLifetime = 4.0;
+										interest.interestLifetime = 4000;  // milliseconds
 										self.expressInterest(ndn, interest, nextClosure);
 									}
 								}
@@ -379,26 +379,30 @@
 		var bytearray = new Uint8Array(binaryInterest.length);
 		bytearray.set(binaryInterest);
 		
-		var pitEntry = new PITEntry(interest, closure);
-		NDN.PITTable.push(pitEntry);
+		if (closure != null) {
+			var pitEntry = new PITEntry(interest, closure);
+			NDN.PITTable.push(pitEntry);
+		}
 		
 		this.ws.send(bytearray.buffer);
 		if (LOG > 3) console.log('ws.send() returned.');
 		
 		// Set interest timer
-		closure.timerID = setTimeout(function() {
-			if (LOG > 3) console.log("Interest time out.");
-			
-			// Remove PIT entry from NDN.PITTable
-			var index = NDN.PITTable.indexOf(pitEntry);
-			//console.log(NDN.PITTable);
-			if (index >= 0) 
-	            NDN.PITTable.splice(index, 1);
-			//console.log(NDN.PITTable);
-			// Raise closure callback
-			closure.upcall(Closure.UPCALL_INTEREST_TIMED_OUT, new UpcallInfo(ndn, interest, 0, null));
-		}, interest.interestLifetime);  // interestLifetime is in milliseconds.
-		//console.log(closure.timerID);
+		if (closure != null) {
+			closure.timerID = setTimeout(function() {
+				if (LOG > 3) console.log("Interest time out.");
+				
+				// Remove PIT entry from NDN.PITTable
+				var index = NDN.PITTable.indexOf(pitEntry);
+				//console.log(NDN.PITTable);
+				if (index >= 0) 
+		            NDN.PITTable.splice(index, 1);
+				//console.log(NDN.PITTable);
+				// Raise closure callback
+				closure.upcall(Closure.UPCALL_INTEREST_TIMED_OUT, new UpcallInfo(ndn, interest, 0, null));
+			}, interest.interestLifetime);  // interestLifetime is in milliseconds.
+			//console.log(closure.timerID);
+		}
 	}
 	else
 		console.log('WebSocket connection is not established.');
