     next: -> throw "Abstract Method"
 
     each: varar(1, 2, (cb, onFinished) ->
+        unless typeof cb is 'function'
+            throw new RqlDriverError "First argument to each must be a function."
+        if onFinished? and typeof onFinished isnt 'function'
+            throw new RqlDriverError "Optional second argument to each must be a function."
+
         brk = false
         n = =>
             if not brk and @hasNext()

# API as cursors.
class ArrayResult extends IterableResult
    hasNext: ar () -> (@__index < @.length)
    next: ar (cb) -> cb(null, @[@__proto__.__index++])

    makeIterable: (response) ->
        for name, method of ArrayResult.prototype

    )

    toArray: ar (cb) ->
        unless typeof cb is 'function'
            throw new RqlDriverError "Argument to toArray must be a function."

        arr = []
        if not @hasNext()
            cb null, arr
