       @connected = false
       @connecting = false
       for i of @currentJobs
-        if @currentJobs.hasOwnProperty(i)
+        if @currentJobs.hasOwnProperty i
           if @currentJobs[i]
             @currentJobs[i].abort()
-            @currentJobs[i].emit "error", new Error("Job failed")
+            @currentJobs[i].emit "error", new Error "Job failed"
           delete @currentJobs[i]
       for i of @currentWorkers
-        if @currentWorkers.hasOwnProperty(i)
-          @currentWorkers[i].finished = true  if @currentWorkers[i]
+        if @currentWorkers.hasOwnProperty i
+          @currentWorkers[i].finished = true if @currentWorkers[i]
           delete @currentWorkers[i]
       @init()
 


  receive_JOB_ASSIGN: (handle, name, payload) ->
    if typeof @workers[name] is "function"
      worker = new Worker(this, handle, name, payload)
      @currentWorkers[handle] = worker
      @workers[name] payload, worker


    len = args.length

    while i < len
      args[i] = new Buffer (args[i] or "").toString(), "utf-8" unless args[i] instanceof Buffer
      bodyLength += args[i].length
      i++
    bodyLength += if args.length > 1 then args.length - 1 else 0
    body = new Buffer bodyLength + 12
    body.writeUInt32BE 0x00524551, 0
    body.writeUInt32BE commandId, 4
    body.writeUInt32BE bodyLength, 8
