It is unclear if the function applyInterest is supposed to return a new balance with the interest applied or only the accrued interest? There are various usages of it, some calls add the return value to the old amount:
This makes the code misbehave and return the wrong values for the balance and accrued interest.
Recommend making it consistent in all cases when calling this function.
