Wallet: use assert for consistency