Currently, all transfers are being taken into account both for credit and debit calculations.
This needs to be changed so that transfers are only accounted for when the recipient is an account marked asexcluded_from_budgets. In that case, the transaction amount is treated as an expense. In all other cases, that transaction shouldn't count towards the budget sums.
When a transfer is made to an account marked as "exclude from budgets", that should be treated by the budget as an expense, as explained here.
However, that's currently not happening. All transactions related to an account marked as "exclude from budgets" are being ignored from budget calculations.