Fix balance calculation