         print ("APP: CurrenciesToMode  : \(currencyCodesToMode)")
 
         // Create the listener
-        let listener = CoreDemoListener (networkCurrencyCodesToMode: currencyCodesToMode,
+        listener = CoreDemoListener (networkCurrencyCodesToMode: currencyCodesToMode,
                                          registerCurrencyCodes: registerCurrencyCodes,
                                          isMainnet: mainnet)
 
         // Create the BlockChainDB
-        let query = BlockChainDB.createForTest ()
+        query = BlockChainDB.createForTest ()
 
         // Create the system
-        self.listener = listener
         self.system = System (listener: listener,
                               account: account,
                               onMainnet: mainnet,

    var listener: CoreDemoListener!
    var system: System!
    var mainnet = true
    var accountSpecification: AccountSpecification!

    var btcPeerSpec = (address: "103.99.168.100", port: UInt16(8333))
    var btcPeer: NetworkPeer? = nil

        
        // Assign and then configure the new system
        app.system = system

        // Passing `[]`... it is a demo app...
        app.system.configure(withCurrencyModels: [])
    }

