lib: fix bug with uninitialized wallets