Fix amount credited to lender after repayment

Lenders that both lender invite credit and own money were not credited
correctly.
See #288