Fix bug in self-check for balances; #2191