         # handle getting more.
         db.query(request, cb)
 
-    (error, result) ->
+    (error, results) ->
       if error?
         console.log('Failed to fetch Operations('+docName+'-'+start+'..'+end+'): '+util.inspect(error))
         callback?('Failure')
       else
         data = []
-        for op in result.get_metadata.Items
+        for op in results.get_metadata.Items
           item = {
             op:   JSON.parse(op.op.S)
             meta: JSON.parse(op.meta.S)

              cb(null, true)
          )
      ]
    (error, result) ->
      if error?
        if error.toString().match "The conditional request failed"
          error = "Document does not exist"

        headers = {}
        data = JSON.stringify(docData.snapshot)

        s3.put(path, headers, data, cb)
    (error, results) ->
      if error? and error.message.match 'The conditional request failed'
        callback?('Document already exists')
      else if error?
