issue #22669: Fix balance calculation.