The money arising from the sale of the property shall be paid to the trustee unless claimed by some other lien which by law may have priority over the deed; and, when there is any surplus after paying the sums due under the deed and other liens, the surplus shall be paid to the maker of the deed or his agent.