Fix swapped in and out on balance calculation.