Don't cache empty balances in wallet
Fix possible failure in wallet::add_contact_account
Minor cleanup