The sale of the thing pledged shall extinguish the principal obligation, whether or not the proceeds of the sale are equal to the amount of the principal obligation, interest and expenses in a proper case. If the price of the sale is more than said amount, the debtor shall not be entitled to the excess, unless it is otherwise agreed. If the price of the sale is less, neither shall the creditor be entitled to recover the deficiency, notwithstanding any stipulation to the contrary. (n)