         numSelectors += numNestedRuleSelectors
         totalNumSelectors += numNestedRuleSelectors
 
-    rulesCache.push rule
+    traversedRules.push rule
 
 
-    # Produce a new AST every time the selector limit is reached and reset
-    # the rules cache.
+    # Produce a new AST every time the selector limit is reached and clear
+    # traversed rules.
     #
     startNewAst() if numSelectors is SELECTOR_LIMIT
 

  # 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.

  newAsts = []


  # Helper function for a pushing a new AST and clearing traversed rules.
  #
  startNewAst = ->
    newAsts.push createAst(traversedRules)
    traversedRules = []
    numSelectors = 0


  # Increment the selector count and track traversed rules.
  #
  for rule in ast.stylesheet.rules
    switch rule.type
