Fix bugs with wallet data storage.