Section 90. A loan of less than one thousand dollars made at a rate of more than six per cent per annum shall be discharged upon payment or tender by the debtor of the principal sum actually borrowed, with interest for the period between the borrowing of said money and the payment or tender hereunder at the rate agreed upon if said rate is not more than eighteen per cent per annum, or at the rate of eighteen per cent per annum if the agreed rate is in excess thereof, for any part of the period occurring prior to the termination of one year after maturity, and in either case at the rate of six per cent per annum for any part of the period occurring after the termination of said year, and a sum not exceeding five dollars for the actual expenses of making and securing the loan; but the lender shall be entitled to interest for six months from the time of the borrowing at said agreed rate or at said rate of eighteen per cent per annum, as the case may be, if the debt is paid before the expiration of said six months. All payments in excess of the rate or rates herein required for discharge by payment or tender shall be applied to the discharge of the principal, and the borrower shall be obliged to pay or tender only the balance of the principal and interest, at said rate or rates, due after such application. This section shall not affect so such of section three of chapter one hundred and seven as provides that if there is no agreement for a different rate the interest of money shall be at the rate of six dollars upon each hundred dollars for a year. If an action is brought upon a loan coming within the purview of this section, the verdict or finding entered for the plaintiff in such action shall in no event exceed the amount that would be required to discharge, by payment or tender, the indebtedness at the time of such verdict or finding. Any agreement whereby the borrower waives the benefits of this section or releases any rights he may have acquired by virtue hereof shall be deemed to be against public policy and void. If, after all deductions or payments, whether on account of interest, expenses or principal made substantially contemporaneously with the making of the loan, the amount retained by the borrower be less than one thousand dollars, the transaction shall be deemed to be a loan in the amount of the sum so retained by the borrower after such deductions or payments, notwithstanding that the loan be nominally for a greater sum.