       #   are tasks in the `QUEUED` list whose group identifier is in the
       #   `BLOCKED` set. The first element of each `QUEUED` list will not be
       #   counted, since that's the blocking (failed) task.
-      #   3. Calculate pending tasks. The equation used to calculate pending
-      #   tasks is:
+      #   3. Calculate pending tasks.
       #
-      # `pending = total - finished - processing - failed - blocked`
+      # The equation used to calculate pending tasks is:
+      #
+      #     pending = total - finished - processing - failed - blocked
       result.blocked.groups = multi_res[4].length
       multi2 = @redis.multi()
-      multi2.llen "#{@key 'QUEUED'}:#{group}" for group in multi_res[4]
+      multi2.llen "#{@key('QUEUED')}:#{group}" for group in multi_res[4]
       multi2.exec (multi2_err, multi2_res) ->
+        return callback multi2_err if multi2_err
         result.blocked.tasks = multi2_res.reduce(((a, b) -> a + b), - result.blocked.groups)
         result.pending_tasks = result.total.tasks - result.finished_tasks - result.processing_tasks - result.failed_tasks - result.blocked.tasks
-        callback result
+        callback null, result

  # **Usage:**
  #
  #     queue.workers (workers) -> YOUR CODE HERE
  workers: (callback) ->
    @redis.hvals @key('WORKERS'), (err, res) ->
      callback err if err
      callback null, res.map (entry) ->
        entry = entry.split '|'
        host: entry[0]

        multi.hincrby @key('STATISTICS'), 'total_processing_time', process_time
        multi.lpush @key('RECENT'), JSON.stringify([task..., finish_time])
        multi.ltrim @key('RECENT'), 0, @recent_size - 1
        multi.zadd @key('SLOWEST'), process_time, JSON.stringify([task..., start_time])
        multi.zremrangebyrank @key('SLOWEST'), 0, - @slowest_size - 1
        multi.exec()

