WIP: Wallet import fixes

please don't merge yet