         var numSplits = 0
         
         var curIdx = self.startIndex
-        for i in self.characters.indices {
+        for i in self.indices {
             let c = self[i]
             if c == by && (maxSplits == 0 || numSplits < maxSplits) {
                 let str = String(self[curIdx..<i])

    
    internal init(_ shortFlag: String?, _ longFlag: String?, _ required: Bool, _ helpMessage: String) {
        if let sf = shortFlag {
            assert(sf.characters.count == 1, "Short flag must be a single character")
            assert(Int(sf) == nil && Double(sf) == nil, "Short flag cannot be a numeric value")
        }
        

        
        // Create path components separated by delimiter (. by default) and get key for root object
		// filter empty path components, these can be caused by delimiter at beginning/end, or multiple consecutive delimiters in the middle
        let pathComponents : Array<String> = primaryKeypath.components(separatedBy: baseDelimiter).filter({ $0.count > 0 })
        primaryKeypath = pathComponents.joined(separator: baseDelimiter)
        let rootKey : String = pathComponents[0]
		
