Note that the balance of a wallet does not equal totalIncoming - totalOutgoing if the wallet is a Delegate. You must then also add the total reward from transaction fees and forged blocks to their balance.