diff --git a/js/tools/build/ndn-js-uncomp.js b/js/tools/build/ndn-js-uncomp.js
index 908c393..b2ec4d4 100644
--- a/js/tools/build/ndn-js-uncomp.js
+++ b/js/tools/build/ndn-js-uncomp.js
@@ -7666,8 +7666,11 @@
 	if (this.host == null || this.port == null) {
         if (this.getHostAndPort == null)
             console.log('ERROR: host OR port NOT SET');
-        else
-            this.connectAndExpressInterest(interest, closure);
+        else {
+            var thisNDN = this;
+            this.connectAndExecute
+                (function() { thisNDN.transport.expressInterest(thisNDN, interest, closure); });
+        }
     }
     else
         this.transport.expressInterest(this, interest, closure);
@@ -7898,9 +7901,9 @@
 
 /*
  * Assume this.getHostAndPort is not null.  This is called when this.host is null or its host
- *   is not alive.  Get a host and port, connect, then express callerInterest with callerClosure.
+ *   is not alive.  Get a host and port, connect, then execute onConnected().
  */
-NDN.prototype.connectAndExpressInterest = function(callerInterest, callerClosure) {
+NDN.prototype.connectAndExecute = function(onConnected) {
     var hostAndPort = this.getHostAndPort();
     if (hostAndPort == null) {
         console.log('ERROR: No more hosts from getHostAndPort');
@@ -7916,7 +7919,7 @@
         
     this.host = hostAndPort.host;
     this.port = hostAndPort.port;   
-    console.log("Trying host from getHostAndPort: " + this.host);
+    if (LOG>3) console.log("Connect: trying host from getHostAndPort: " + this.host);
     
     // Fetch any content.
     var interest = new Interest(new Name("/"));
@@ -7924,22 +7927,21 @@
 
     var thisNDN = this;
 	var timerID = setTimeout(function() {
-        console.log("Timeout waiting for host " + thisNDN.host);
+        if (LOG>3) console.log("Connect: timeout waiting for host " + thisNDN.host);
         // Try again.
-        thisNDN.connectAndExpressInterest(callerInterest, callerClosure);
+        thisNDN.connectAndExecute(onConnected);
 	}, 3000);
   
     this.transport.expressInterest
-        (this, interest, new NDN.ConnectClosure(this, callerInterest, callerClosure, timerID));
+        (this, interest, new NDN.ConnectClosure(this, onConnected, timerID));
 };
 
-NDN.ConnectClosure = function ConnectClosure(ndn, callerInterest, callerClosure, timerID) {
+NDN.ConnectClosure = function ConnectClosure(ndn, onConnected, timerID) {
     // Inherit from Closure.
     Closure.call(this);
     
     this.ndn = ndn;
-    this.callerInterest = callerInterest;
-    this.callerClosure = callerClosure;
+    this.onConnected = onConnected;
     this.timerID = timerID;
 };
 
@@ -7949,10 +7951,9 @@
         // The upcall is not for us.
         return Closure.RESULT_ERR;
         
-    // The host is alive, so cancel the timeout and issue the caller's interest.
+    // The host is alive, so cancel the timeout and continue with onConnected().
     clearTimeout(this.timerID);
-    console.log(this.ndn.host + ": Host is alive. Fetching callerInterest.");
-    this.ndn.transport.expressInterest(this.ndn, this.callerInterest, this.callerClosure);
+    this.onConnected();
 
     return Closure.RESULT_OK;
 };
