             
             guard data != nil else {
                 print("Error performing Yahoo query.")
+                UIApplication.sharedApplication().networkActivityIndicatorVisible = false
                 return
             }
             

        let useSymbol: Bool = currency.useSymbol
        let useCustomSymbol: Bool = currency.useCustomSymbol
        
        // Finish by hiding the network indicator.
        UIApplication.sharedApplication().networkActivityIndicatorVisible = false
        
        return(name, code, rate, locale, symbol, decimals, symbolPosition, useLocalization, useSymbol, useCustomSymbol)
    }
    
    private func updateRate() {
        let url = NSURL(string: "https://query.yahooapis.com/v1/public/yql?q=" +
            "select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(" +
            "%22USD" + self.code + "%22)&diagnostics=true&env=store%3A%2F%2F" +

            useLocalization: Bool,
            useSymbol: Bool,
            useCustomSymbol: Bool) {
        
        // CoreData setup.
        let managedObjectContext: NSManagedObjectContext!
