fix a number of error conditions

bug: https://issues.apache.org/jira/browse/CB-284

invocation exception on WeinreClientEventsImpl.connectionCreated(): \
    TypeError: Cannot read property 'url' of undefined

The original problem logged in this issue was just one of the
problems fixed.  There were a handful of others.  Added
error checking where I could, and where I couldn't, I changed
the logger to not display a warning message (bug in Web Inspector).

Drive-by fixes for:

- changing the sequence number of channels to start at 1 instead
of a random number.  Note that the primary reason to use a
random number is to because the server can get confused
when you start/stop but have clients/targets that try to
reconnect with the same channel number.  Not a problem at all
in deployment, but a hassle at development time - or used to
be.  I'm going to try turning the 'random' off and see how
it goes.

- dump the pid at startup when in verbose mode; making it
easier to run top/dtrace/etc.
diff --git a/weinre.server/lib/utils.coffee b/weinre.server/lib/utils.coffee
index 39bc5ab..2225d22 100644
--- a/weinre.server/lib/utils.coffee
+++ b/weinre.server/lib/utils.coffee
@@ -24,7 +24,7 @@
 utils.Program = Program = path.basename process.argv[1]
 
 SequenceNumberMax = 100 * 1024 * 1024
-SequenceNumber    = Math.floor(Math.random() * SequenceNumberMax)
+SequenceNumber    = 0
 
 #-------------------------------------------------------------------------------
 utils.getNextSequenceNumber = (g) -> 
diff --git a/weinre.server/lib/weinre.coffee b/weinre.server/lib/weinre.coffee
index a334596..6027d05 100644
--- a/weinre.server/lib/weinre.coffee
+++ b/weinre.server/lib/weinre.coffee
@@ -61,13 +61,14 @@
     
     options.staticWebDir = getStaticWebDir()
     
-    utils.logVerbose "version:              #{getVersion()}"
-    utils.logVerbose "option httpPort:      #{options.httpPort}"
-    utils.logVerbose "option boundHost:     #{options.boundHost}"
-    utils.logVerbose "option verbose:       #{options.verbose}"
-    utils.logVerbose "option debug:         #{options.debug}"
-    utils.logVerbose "option readTimeout:   #{options.readTimeout}"
-    utils.logVerbose "option deathTimeout:  #{options.deathTimeout}"
+    utils.logVerbose "pid:                 #{process.pid}"
+    utils.logVerbose "version:             #{getVersion()}"
+    utils.logVerbose "option httpPort:     #{options.httpPort}"
+    utils.logVerbose "option boundHost:    #{options.boundHost}"
+    utils.logVerbose "option verbose:      #{options.verbose}"
+    utils.logVerbose "option debug:        #{options.debug}"
+    utils.logVerbose "option readTimeout:  #{options.readTimeout}"
+    utils.logVerbose "option deathTimeout: #{options.deathTimeout}"
 
     utils.setOptions options
 
diff --git a/weinre.server/weinre-hot b/weinre.server/weinre-hot
index cce978b..700e780 100755
--- a/weinre.server/weinre-hot
+++ b/weinre.server/weinre-hot
@@ -25,6 +25,6 @@
 # to determine whether to kill and restart the server.
 
 cd `dirname $0`
-supervisor -n -p 1 -e txt -w ../weinre.build/out/build-done.txt node weinre
+supervisor -n -p 1 -e txt -w ../weinre.build/out/build-done.txt -- weinre $*
 
 # supervisor: https://github.com/isaacs/node-supervisor
\ No newline at end of file
diff --git a/weinre.web/modules/weinre/client/WeinreClientEventsImpl.coffee b/weinre.web/modules/weinre/client/WeinreClientEventsImpl.coffee
index 8fcec0d..5152771 100644
--- a/weinre.web/modules/weinre/client/WeinreClientEventsImpl.coffee
+++ b/weinre.web/modules/weinre/client/WeinreClientEventsImpl.coffee
@@ -56,9 +56,10 @@
 
     #---------------------------------------------------------------------------
     connectionCreated: (clientChannel, targetChannel) ->
-        if @client.uiAvailable()
-            WebInspector.panels.remote.setClientState clientChannel, "connected"
-            WebInspector.panels.remote.setTargetState targetChannel, "connected"
+        return if !@client.uiAvailable()
+
+        WebInspector.panels.remote.setClientState clientChannel, "connected"
+        WebInspector.panels.remote.setTargetState targetChannel, "connected"
 
         return unless clientChannel == Weinre.messageDispatcher.channel
 
@@ -67,6 +68,8 @@
         WebInspector.panels.resources.reset()
 
         target = WebInspector.panels.remote.getTarget(targetChannel)
+        return if !target
+
         document.title = titleConnectedPrefix + target.url
         WebInspector.inspectedURLChanged target.url
 
@@ -75,9 +78,10 @@
 
     #---------------------------------------------------------------------------
     connectionDestroyed: (clientChannel, targetChannel) ->
-        if @client.uiAvailable()
-            WebInspector.panels.remote.setClientState clientChannel, "not-connected"
-            WebInspector.panels.remote.setTargetState targetChannel, "not-connected"
+        return if !@client.uiAvailable()
+        
+        WebInspector.panels.remote.setClientState clientChannel, "not-connected"
+        WebInspector.panels.remote.setTargetState targetChannel, "not-connected"
 
         return unless clientChannel == Weinre.messageDispatcher.channel
 
diff --git a/weinre.web/modules/weinre/common/MessageDispatcher.coffee b/weinre.web/modules/weinre/common/MessageDispatcher.coffee
index 404a951..37a0cc4 100644
--- a/weinre.web/modules/weinre/common/MessageDispatcher.coffee
+++ b/weinre.web/modules/weinre/common/MessageDispatcher.coffee
@@ -149,6 +149,12 @@
 
     #---------------------------------------------------------------------------
     _handleMessage: (message) ->
+        skipErrorForMethods = [
+            'domContentEventFired'
+            'loadEventFired'
+            'childNodeRemoved'
+        ]
+
         try
             data = JSON.parse(message.data)
         catch e
@@ -176,7 +182,8 @@
         try
             method.apply intf, args
         catch e
-            Weinre.logError "weinre: invocation exception on #{methodSignature}: " + e
+            if methodName not in skipErrorForMethods
+                Weinre.logError "weinre: invocation exception on #{methodSignature}: " + e
 
         if Verbose
             Weinre.logDebug @constructor.name + "[#{@_url}]: recv #{intfName}.#{methodName}(#{JSON.stringify(args)})"
diff --git a/weinre.web/modules/weinre/target/NodeStore.coffee b/weinre.web/modules/weinre/target/NodeStore.coffee
index b12fe1f..c80339c 100644
--- a/weinre.web/modules/weinre/target/NodeStore.coffee
+++ b/weinre.web/modules/weinre/target/NodeStore.coffee
@@ -202,7 +202,8 @@
       return unless parentId
 
       if targetId
-          Weinre.wi.DOMNotify.childNodeRemoved parentId, targetId
+          if parentId
+              Weinre.wi.DOMNotify.childNodeRemoved parentId, targetId
       else
           childCount = Weinre.nodeStore.childNodeCount(event.relatedNode)
           Weinre.wi.DOMNotify.childNodeCountUpdated parentId, childCount
diff --git a/weinre.web/modules/weinre/target/WiRuntimeImpl.coffee b/weinre.web/modules/weinre/target/WiRuntimeImpl.coffee
index 7a1584c..51b9b3e 100644
--- a/weinre.web/modules/weinre/target/WiRuntimeImpl.coffee
+++ b/weinre.web/modules/weinre/target/WiRuntimeImpl.coffee
@@ -53,7 +53,7 @@
 
     #---------------------------------------------------------------------------
     releaseWrapperObjectGroup: (injectedScriptId, objectGroup, callback) ->
-        result = Weinre.injectedScript.releaseWrapperObjectGroup(objectGroupName)
+        result = Weinre.injectedScript.releaseWrapperObjectGroup(objectGroup)
         if callback
             Weinre.WeinreTargetCommands.sendClientCallback callback, [ result ]