         if count == 1 {
             return self
         } else {
-            if countElements(with) != 0 {
+            if with.length != 0 {
                 return with
             } else {
                 return Pluralize.apply(self)
             }
         }
     }
+
+    // Workaround to allow us to use `count` as an argument name in pluralize() above.
+    private var length: Int {
+        return count(self)
+    }
 }

    
    private class func regexReplace(input: String, pattern: String, template: String) -> String {
        var regex = NSRegularExpression(pattern: pattern, options: .CaseInsensitive, error: nil)!
        var range = NSMakeRange(0, countElements(input))
        var output = regex.stringByReplacingMatchesInString(input, options: nil, range: range, withTemplate: template)
        return output
    }

    }
    
    public class func apply(var word: String) -> String {
        if contains(sharedInstance.uncountables, word.lowercaseString) || count(word) == 0 {
            return word
        } else {
            for pair in sharedInstance.rules {
