           return counter = 0
 
         done &&= _done
-
-        if _declarations.length
-          allDeclarations = allDeclarations.concat(_declarations)
-
-        if _clear.length
-          allClear = allClear.concat(_clear)
-
-        if _done
-          virtualParameterUpdates.push(_returnValue)
+        allDeclarations[j] = _declarations or []
+        allClear[j] = _clear or []
+        virtualParameterUpdates[j] = _returnValue if _done
 
         if (counter -= 2) == 1
           toClear = null
-          if virtualParameterUpdates.length == provisions.length
+          if done
             for vpu, i in virtualParameterUpdates
               toClear = commitVirtualParameter(sessionContext, provisions[i], vpu, toClear)
 
           clear(sessionContext, toClear, (err) ->
+            allDeclarations = Array.prototype.concat.apply([], allDeclarations)
+            allClear = Array.prototype.concat.apply([], allClear)
             return callback(err, null, done, allDeclarations, allClear)
           )
       )
 
   if (counter -= 2) == 1
     toClear = null
-    if virtualParameterUpdates.length == provisions.length
+    if done
       for vpu, i in virtualParameterUpdates
         toClear = commitVirtualParameter(sessionContext, provisions[i], vpu, toClear)
 
     clear(sessionContext, toClear, (err) ->
+      allDeclarations = Array.prototype.concat.apply([], allDeclarations)
+      allClear = Array.prototype.concat.apply([], allClear)
       return callback(err, null, done, allDeclarations, allClear)
     )
 

          return counter = 0

        done &&= _done

        if _declarations.length
          allDeclarations = allDeclarations.concat(_declarations)

        if _clear.length
          allClear = allClear.concat(_clear)

        if (counter -= 2) == 1
          return callback(null, null, done, allDeclarations, allClear)
      )

  if (counter -= 2) == 1
    return callback(null, null, done, allDeclarations, allClear)



  allClear = []
  counter = 3
  allVirtualParameters = virtualParametersCache.get(sessionContext)
  for provision, j in provisions
    counter += 2
    globals = {TIMESTAMPS: provision[1], VALUES: provision[2]}
    do (j) -> sandbox.run(allVirtualParameters[provision[0]].script, globals,
      sessionContext, startRevision, endRevision,
      (err, _fault, _clear, _declarations, _done, _returnValue) ->
        if err or _fault
