         )
       delegator[key] = serializedModels
 
-  # Remove model from stack
-  modelStack.pop()
+  # Remove model from stack.
+  delete modelStack[model.cid]
 
   # Return the delegator
   delegator

  delegator = utils.beget attributes

  # Add model to stack
  if modelStack
    modelStack.push model
  else
    modelStack = [model]

  # Map model/collection to their attributes. Create a property
  # on the delegator that shadows the original attribute.

# in the context of a given tree
serializeModelAttributes = (model, currentModel, modelStack) ->
  # Nullify circular references
  return null if model is currentModel or _(modelStack).has model.cid
  # Serialize recursively
  attributes = if typeof model.getAttributes is 'function'
    # Chaplin models
