             if !NSEqualRanges(rangeOfFirstMatch!, NSMakeRange(NSNotFound, 0)) {
                 let nsLineStr = lineStr as NSString?
                 let substringForFirstMatch = nsLineStr?.substring(with: rangeOfFirstMatch!) as NSString?
-                if (substringForFirstMatch?.range(of: ".").length) != nil {
+                if substringForFirstMatch?.range(of: ".").length != 0 {
                     scaleDegree = Element(lineStr)!
                     // ignore 0.0...same as 1.0, 2.0, etc.
                     if scaleDegree != 0 {

            return nil
        }
        
        return noteArray
    }
}

                    }
                }
                else {
                    if (substringForFirstMatch?.range(of: "/").length) != 0 {
                        if (substringForFirstMatch?.range(of: "-").length) != 0 {
                            AKLog("ERROR: invalid ratio: \(String(describing: substringForFirstMatch))")
                            parsedScala = false
                            break
