   # Convert any remaining rules to a new AST. This also accounts for the case
   # where the selector limit was not reached.
   #
-  newAsts.push createAst(rulesCache) if rulesCache.length
+  newAsts.push createAst(traversedRules) if traversedRules.length
 
   newData = (css.stringify ast for ast in newAsts)
 

  # The rules which have been traversed. Used to easily produce a new AST
  # using previously traversed nodes.
  #
  rulesCache = []

  # ASTs which represent the stylesheets which should be created as a result
  # of processing.

        numSelectors += numNestedRuleSelectors
        totalNumSelectors += numNestedRuleSelectors

    traversedRules.push rule


    # Produce a new AST every time the selector limit is reached and clear
    # traversed rules.
    #
    startNewAst() if numSelectors is SELECTOR_LIMIT

