                     continue
                 }
 
-                if !nonRepeatableFinished || repeatableTypes.containsObject(type) {
+                if !nonRepeatableFinished || repeatableTypes.contains(type) {
                     let last: AnyObject = stacks[type]!.removeLast()
                     self._patterns.append(type)
                     self._contents.append(last)

            var nonRepeatableFinished = false
            for type in from {
                if stacks[type]? == nil || stacks[type]!.count == 0 {
                    if repeatableTypes.containsObject(type) {
                        repeatableTypes.removeObject(type)
                    } else {
                        nonRepeatableFinished = true
                    }

            stacks[type] = reverse(contents)
        }

        var repeatableTypes = Set<String>()
        if let repeatables = self.repeatables {
            repeatableTypes.intersect(Set(self.pattern))
            for type in self.pattern {
                if contains(repeatables, type) {
                    repeatableTypes.insert(type)
                }
            }
        }
