Fixed memory leaks in balance routine, balance is now called at the conclusion of each buffer operation.