**Exhibit 10.4**

 

**AMENDED AND RESTATED**

**FOURTH SUPPLEMENT**

**TO THE MASTER LOAN AGREEMENT**

**(TERM REVOLVING LOAN)**

 

**THIS AMENDED AND RESTATED FOURTH SUPPLEMENT TO THE MASTER LOAN AGREEMENT**(this **“Fourth Supplement”**), dated as of April 27, 2011, is between **AGSTAR FINANCIAL SERVICES, PCA,**an United States corporation (the **“Lender”**) and**HERON LAKE BIOENERGY,  LLC,**a Minnesota limited liability company (the **“Borrower”**), and supplements and incorporates all of the provisions of that certain Fourth Amended and Restated Master Loan Agreement dated October 1, 2007, between the Lender and the Borrower (as the same has been amended, modified, supplemented, extended or restated from time to time, the **“MLA”**).

 

1.                                       **Definitions****.**  As used in this Fourth Supplement, the following terms shall have the following meanings.  Capitalized terms used and not otherwise defined in this Fourth Supplement shall have the meanings attributed to such terms in the MLA.  Terms not defined in either this Fourth Supplement or the MLA shall have the meanings attributed to such terms in the Uniform Commercial Code, as enacted in the State of Minnesota and as amended from time to time.

 

“First Supplement” means that certain Amended and Restated First Supplement dated                        December 27, 2006.

 

“HLBE — PC” means HLBE Pipeline Company, LLC, a Minnesota limited liability company, a wholly owned subsidiary of Borrower.

 

“HLBE — PC Investment” shall have the meaning specified in Section 4 of this Fourth Supplement.

 

“Monthly Payment Date” means the first (1st) day of each calendar month.

 

“Outstanding Credit” means, at any time of determination, the aggregate amount of Advances then outstanding.

 

“Outstanding Revolving Advance” means the total Outstanding Credit under this Fourth Supplement and the Term Revolving Note.

 

“Pipeline Project” means any and all buildings, structures, fixtures and other improvements made on or for the benefit of the Project or the Real Property and part of the construction of a natural gas pipeline connecting Borrower’s ethanol production facility to the natural gas pipeline facilities of Northern Border Pipeline Company in Cottonwood County, Minnesota.

 

“Pipeline Project Budget” means the statement attached hereto as Exhibit A which identifies the sources and uses of monies in the amount of $3,148,604 for the construction of the Pipeline Project.

 

“Request for Advance” shall have the meaning specified in Section 7(a) of this Fourth Supplement.

 

“Revolving Advance” means an advance under this Fourth Supplement and the Term Revolving Note.

 

----

 

“Term Revolving Note” means that certain promissory note dated October 1, 2007, in the amount of $5,000,000.00 pursuant to the terms and conditions provided for in this Fourth Supplement and the MLA.

 

“Term Revolving Loan Commitment” shall mean the following:

 
| On the Closing Date  |   | $ | 5,000,000.00 |   |
|----------------------|--------|---|--------------|--------|
| October 1, 2008 |   | $ | 4,500,000.00 |   |
| October 1, 2009 |   | $ | 4,000,000.00 |   |
| October 1, 2010 |   | $ | 3,500,000.00 |   |
| October 1, 2011 |   | $ | 3,000,000.00 |   |

 

“Term Revolving Loan Maturity Date” means October 1, 2012.

 

“Term Revolving Loan Termination Date” shall have the meaning specified in Section 3 of this Fourth Supplement.

 

“Unused Commitment Fee” shall have the meaning specified in Section 7(d) of this Fourth Supplement.

 

2.                                       **[Intentionally Omitted.]**

 

3.                                       **Term Revolving Loan Commitment**.  On the terms and conditions set forth in the MLA and this Fourth Supplement, Lender agrees to make one or more advances to the Borrower, during the period beginning on the effective date of this Fourth Supplement and ending on the Business Day immediately preceding the Term Revolving Loan Maturity Date (the “**Term Revolving Loan Termination Date**”), in an aggregate principal amount outstanding at any one time not to exceed Term Revolving Loan Commitment.  The Term Revolving Loan Commitment shall expire at 12:00 noon Central time on the Term Revolving Loan Maturity Date.  Term Revolving Loan amounts borrowed and repaid or prepaid may be reborrowed at any time prior to and including the Term Revolving Loan Termination Date *provided, however,*that at no time shall the sum of the Outstanding Revolving Advances exceed the Term Revolving Loan Commitment.  The Borrower shall, without penalty or premium and within five (5) days following October 1 of each year, prepay the Outstanding Revolving Advances in the amount, if any, by which the Outstanding Credit on such date exceeds the Term Revolving Loan Commitment then in effect, together with accrued interest thereon to the date of such prepayment.

 

4.                                       **Purpose****.**  Revolving Advances under the Term Revolving Loan may be used for cash and inventory management purposes of the Borrower, including closing costs and fees associated with the Term Revolving Loan.  In addition to the foregoing, Borrower may use the proceeds of one or more Revolving Advances to make equity investments in, and to acquire all of the limited liability company membership interest in HLBE — PC (the “**HLBE — PC Investment**”).  The Borrower agrees that the proceeds of the Term Revolving Loan are to be used only for the purposes set forth in this Section 4.

 

5.                                       **Repayment of the Term Revolving Loan****.**  The Borrower will pay interest on the Term Revolving Loan on the first (1st) day of each month, commencing on the first (1st) Monthly Payment Date following the date on which the first Advance is made on the Term Revolving Loan, and continuing on each Monthly Payment Date thereafter until the Term Revolving Loan Maturity Date.  On the Term Revolving Loan Maturity Date, the amount of the then unpaid principal balance of the Term Revolving Loan and any and all other amounts due and owing hereunder or under any other Loan Document relating to the Term Revolving Loan shall be due and payable.  If any Payment Date is not a Business Day, then

 

2

----

 

the principal installment then due shall be paid on the next Business Day and shall continue to accrue interest until paid.

 

6.                                       **Term Revolving Loan Term****. **The Term Revolving Loan shall mature on the Term Revolving Loan Maturity Date.

 

**7.****                                     ****Making the Advances.**

 

(a)                                  **Revolving Advances**.  Each Revolving Advance shall be made, on notice from the Borrower (a “**Request for Advance**”) to the Lender delivered before 12:00 Noon (Minneapolis, Minnesota time) on a Business Day which is at least three (3) Business Days prior to the date of such Revolving Advance specifying the amount of such Revolving Advance,  provided that, no Revolving Advance shall be made while an Event of Default exists or if the interest rate for such LIBOR Rate Loan would exceed the Maximum Rate.  Any Request for Advance applicable to a Revolving Advance received after 12:00 Noon (Minneapolis, Minnesota time) shall be deemed to have been received and be effective on the next Business Day.  The amount so requested from the Lender shall, subject to the terms and conditions of this Fourth Supplement, be made available to the Borrower by:  (i) depositing the same, in same day funds, in an account of the Borrower; or (ii) wire transferring such funds to a Person or Persons designated by the Borrower in writing.

 

(b)                                 **Requests for Advances Irrevocable**.  Each Request for Advance shall be irrevocable and binding on the Borrower and the Borrower shall indemnify the Lender against any loss or expense it may incur as a result of any failure to borrow any Advance after a Request for Advance (including any failure resulting from the failure to fulfill on or before the date specified for such Advance the applicable conditions set forth in this Section 7 of this Fourth Supplement and the MLA), including, without limitation, any loss (including loss of anticipated profits) or expense incurred by reason of the liquidation or reemployment of deposits or other funds acquired by the Lender to fund such Advance when such Advance, as a result of such failure, is not made on such date.

 

(c)                                  **Minimum Amounts**.  Each Revolving Advance shall be in a minimum amount equal to $50,000.00.

 

(d)                                 **Unused Commitment****Fee**.  In addition to the fees payable on the effective date of this Fourth Supplement, Borrower agrees to pay to the Lender an Unused Commitment Fee on the average daily unused portion of such Lender’s commitment under the Term Revolving Loan at the rate of 0.35% per annum, payable in arrears in quarterly installments payable on the first (1st) day of each calendar quarter during the term of the Term Revolving Loan.

 

(e)                                  **Conditions Precedent to All Advances**.  The Lender’s obligation to make each Advance under the Term Revolving Note shall be subject to the terms, conditions and covenants set forth in the MLA and this Fourth Supplement, including, without limitation, the following further conditions precedent:

 

(i)                                     Representations and Warranties.  The representations and warranties set forth in the MLA and this Fourth Supplement are true and correct in all material respects as of the date of the request for any Advance, except as disclosed in writing to the Lender, to the same extent and with the same effect as if made at and as of the date thereof except as disclosed in writing to the Lender;

 

(ii)                                  No Defaults.  The Borrower is not in default under the terms of the MLA, this Fourth Supplement, the Related Documents or any other Material Contracts to which the

 

3

----

 

Borrower is a party and which relates to the construction of the Pipeline Project or the operation of the Borrower’s business; and

 

(iii)                               Government Action.  No license, permit, permission or authority necessary for the construction or operation of the Pipeline Project has been revoked or challenged by or before any Governmental Authority.

 

8.                                       **Interest Rate**.  Subject to the provisions of Section 2.08 and 2.11 of the MLA and Sections 9 and 12 of this Fourth Supplement, the Term Revolving Loan shall bear interest at a rate equal to the LIBOR Rate plus 325 basis points.  The computation of interest, amortization, maturity and other terms and conditions of the Term Revolving Loan shall be as provided in the Term Revolving Note, provided, however, in no event shall the applicable rate exceed the maximum nonusurious interest rate, if any, that at any time, or from time to time, may be contracted for, taken, reserved, charged, or received under applicable state or federal laws (the “**Maximum Rate**”).

 

9.                                       **Default Interest**.  In addition to the rights and remedies set forth in the MLA:  (i) if the Borrower fails to make any payment to Lender when due, then at Lender’s option in each instance, such obligation or payment shall bear interest from the date due to the date paid at 2% per annum in excess of the rate of interest that would otherwise be applicable to such obligation or payment; (ii) upon the occurrence and during the continuance of an Event of Default beyond any applicable cure period, if any, at Lender’s option in each instance, the unpaid balances of the Term Revolving Loan shall bear interest from the date of the Event of Default or such later date as Lender shall elect at 2% per annum in excess of the rate(s) of interest that would otherwise be in effect on the Term Revolving Loan under the terms of the Term Revolving Note; (iii) after the maturity of the Term Revolving Loan, whether by reason of acceleration or otherwise, the unpaid principal balance of the Term Revolving Loan (including without limitation, principal, interest, fees and expenses) shall automatically bear interest at 2% per annum in excess of the rate of interest that would otherwise be in effect on the Term Revolving Loan under the terms of the Term Revolving Note.  Interest payable at the Default Rate shall be payable from time to time on demand or, if not sooner demanded, on the last day of each calendar month.

 

10.                                 **Late Charge**.  If any payment of principal or interest due under this Fourth Supplement or the Term Revolving Note is not paid within ten (10) days of the due date thereof, the Borrower shall, in addition to such amount, pay a late charge equal to five percent (5%) of the amount of such payment.

 

11.                                 **Excess Cash Flow****. **At the end of each calendar quarter, in addition to all other payments of principal and interest required under the MLA, this Fourth Supplement, and the Term Revolving Note, the Borrower shall remit to Lender an amount equal to 25% of the Borrower’s Excess Cash Flow for the immediately preceding calendar quarter (the “**Excess Cash Flow Payment**”), *provided however*, that the total Excess Cash Flow Payments required hereunder shall not exceed $2,000,000.00 in any calendar year.  All Excess Cash Flow Payments shall be applied to the reduction of the outstanding principal balance of the Term Loan or the Term Revolving Loan, at the Lender’s sole discretion.  No Excess Cash Flow Payments shall be required during any calendar year should the Tangible Owner’s Equity be greater than 50% at the end of the immediately proceeding fiscal year of the Borrower.

 

12.                                 **Changes in Law Rendering Certain LIBOR Rate Loans Unlawful**.  In the event that any change in any applicable law (including the adoption of any new applicable law) or any change in the interpretation of any applicable law by any judicial, governmental or other regulatory body charged with the interpretation, implementation or administration thereof, should make it (or in the good-faith judgment of the Lender should raise a substantial question as to whether it is) unlawful for the Lender to make, maintain or fund LIBOR Rate Loans, then:  (a) the Lender shall promptly notify Borrower; and (b) the obligation of the Lender to make LIBOR rate loans of such type shall, upon the effectiveness of

 

4

----

 

such event, be suspended for the duration of such unlawfulness.  During the period of any suspension, Lender shall make loans to Borrower that are deemed lawful and that as closely as possible reflect the terms of the MLA.

 

13.                                 **Maximum Amount Limitation**.  Anything in the MLA, this Fourth Supplement, or the other Loan Documents to the contrary notwithstanding, Borrower shall not be required to pay unearned interest on the Term Revolving Note or any of the Loan Obligations, or ever be required to pay interest on the Term Revolving Note or any of the Loan Obligations at a rate in excess of the Maximum Rate, if any.  If the effective rate of interest which would otherwise be payable under the MLA, this Fourth Supplement, the Term Revolving Note, or any of the other Loan Documents would exceed the Maximum Rate, if any, then the rate of interest which would otherwise be contracted for, charged, or received under the MLA, this Fourth Supplement, the Term Revolving Note, or any of the other Loan Documents shall be reduced to the Maximum Rate, if any.  If any unearned interest or discount or property that is deemed to constitute interest (including, without limitation, to the extent that any of the fees payable by Borrower for the Loan Obligations to the Lender under the MLA, this Fourth Supplement, the Term Revolving Note, or any of the other Loan Documents are deemed to constitute interest) is contracted for, charged, or received in excess of the Maximum Rate, if any, then such interest in excess of the Maximum Rate shall be deemed a mistake and canceled, shall not be collected or collectible, and if paid nonetheless, shall, at the option of the holder of the Term Revolving Note, be either refunded to the Borrower, or credited on the principal of the Term Revolving Note.  It is further agreed that, without limitation of the foregoing and to the extent permitted by applicable law, all calculations of the rate of interest or discount contracted for, charged or received by the Lender under the Term Revolving Note, or under any of the Loan Documents, that are made for the purpose of determining whether such rate exceeds the Maximum Rate applicable to the Lender, if any, shall be made, to the extent permitted by applicable laws (now or hereafter enacted), by amortizing, prorating and spreading during the period of the full terms of the Advances evidenced by the Term Revolving Note, and any renewals thereof all interest at any time contracted for, charged or received by Lender in connection therewith.  This section shall control every other provision of all agreements among the parties to the MLA pertaining to the transactions contemplated by or contained in the Loan Documents, and the terms of this section shall be deemed to be incorporated in every Loan Document and communication related thereto.

 

14.                                 **Security****.**  The Borrower’s obligations hereunder and, to the extent related thereto, the MLA, shall be secured as provided in the MLA.

 

15.                                 **Representation and Warranty****. **The Borrower hereby agrees with, reaffirms, and acknowledges that Borrower has the power and authority to execute, deliver, and perform this Fourth Supplement and any documents required under this Fourth Supplement and that all documents contemplated herein when executed and delivered to Lender will constitute the valid, binding and legally enforceable obligations of Borrower in accordance with their respective terms and conditions, except as enforceability may be limited by any applicable bankruptcy or insolvency laws.

 

16.                                 **Effect on First Supplement****. **This Fourth Supplement, the Term Revolving Note, the Third Supplement, and the Term Note shall supersede and replace in their entirety the First Supplement and Construction Note which shall be of no force or effect.

 

17.                                 **Construction of the Natural Gas Pipeline**.  Borrower shall, and shall cause all of its subsidiaries and Affiliates to:

 

(a)                                  diligently proceed with, and complete construction of, the Pipeline Project in accordance with plans and specifications and Pipeline Project Budget provided to the Lender, and in accordance with all applicable laws and ordinances;

 

5

----

 

(b)                                 use commercially reasonable best efforts to require all Contractors to comply with all rules, regulations, ordinances and laws relating to work on the Pipeline Project;

 

(c)                                  obtain the Lender’s prior written approval of any change in the timeline or plans and specifications for the Pipeline Project or to the Pipeline Project Budget, which might materially adversely affect the value of the Lender’s Security Interests in the Collateral, and has a cost of $25,000.00 or greater.  The Lender will have a reasonable time to evaluate any requests for its approval of any changes referred to in this subsection. The Lender may approve or disapprove changes in its discretion, reasonably exercised;

 

(d)                                 comply with and keep in effect all necessary permits and approvals obtained from any Governmental Authority relating to the lawful construction of the Pipeline Project; and comply with all applicable laws, regulations, orders, and requirements of any Governmental Authority, judicial, or legal authorities having jurisdiction over the Real Property or Pipeline Project, and with all recorded restrictions affecting the Real Property;

 

(e)                                  furnish to the Lender from time to time on request by the Lender, in a form acceptable to the Lender, correct lists of all contractors and subcontractors employed in connection with construction of the Pipeline Project and true and correct copies of all executed contracts and subcontracts.  The Lender may contact any contractor or subcontractor to verify any facts disclosed in the lists, Borrower must consent to, or obtain the consent to, the disclosure of such information by the contractors and subcontractors to Lender or its agents upon Lender’s request, and Borrower must assist Lender or its agents in obtaining such information upon Lender’s request;

 

(f)                                    provide the Lender and its representatives with access to the Real Property and the Pipeline Project at any reasonable time and upon reasonable notice to enter the Real Property and inspect the work or construction and all materials, plans, specifications, and other matters relating to the construction.  The Lender will also have the right to, at any reasonable time and upon reasonable notice, examine, copy, and audit the books, records, accounting data, and other documents relating to the Real Property or construction of the Pipeline Project;

 

(g)                                 pay and discharge all claims and liens for labor done and materials and services furnished in connection with the construction of the Pipeline Project.  The Borrower and its subsidiaries and Affiliates shall have the right to contest in good faith any claim or lien, provided that it does so diligently and without prejudice to the Lender or Lender’s Security Interests in the Collateral.  Upon the Lender’s request, the Borrower will, or will cause its subsidiaries or Affiliates to, promptly provide a bond, cash deposit, or other security reasonably satisfactory to the Lender to protect the Lender’s interest and Security Interests in the Collateral should the contest be unsuccessful;

 

(h)                                 maintain in force until completion of the Pipeline Project builder’s risk  insurance in such amounts, form, risk coverage, deductibles, insurer, loss payable and cancellation provisions as are usual, customary and reasonable for project of the nature and scope of the Pipeline Project;

 

(i)                                     take such actions as are reasonable and necessary to bring about the timely completion of the Pipeline Project, and resolve all disputes arising during the work of construction thereof in a manner which will allow work to proceed expeditiously.  With respect to such disputes, the Borrower, and its subsidiaries and Affiliates will have the right to contest in good faith claims resulting in disputes, provided that it does so diligently and without prejudice to the Lender or Lender’s Security Interests in the Collateral.  Upon the Lender’s request, the Borrower will, or will cause its subsidiaries or Affiliates to, promptly provide a bond, cash deposit, or other security reasonably satisfactory to the

 

6

----

 

Lender to protect the Lender’s interest and Security Interests in the Collateral should the contest be unsuccessful;

 

(j)                                     pay the Lender’s out of pocket costs and expenses incurred in connection in the exercise of any of its rights or remedies under this Agreement, including but not limited to legal fees and disbursements, and reasonable fees and costs for services which are not customarily performed by the Lender’s salaried employees and are not specifically covered by the fees charged to originate the Loans, if any.  The provision of this paragraph will survive the termination of this Agreement and the repayment of the Loans;

 

(k)                                  keep true and correct financial books and records on a cash basis for the construction of the Pipeline Project and maintain adequate reserves for all contingencies.  If required by the Lender, submit to the Lender at such times as it requires (which will in no event be more often than monthly) a statement which accurately shows the application of all funds expended to date for construction of the Pipeline Project and the source of those funds as well as an estimate of the funds needed to complete the Pipeline Project and the source of those funds.  The Borrower will promptly supply the Lender with all financial statements and other information concerning its affairs and the affairs of its subsidiaries and Affiliates, as the Lender may reasonably request, and promptly notify the Lender of any material adverse change in its or their financial condition or in the physical condition of the Property or Pipeline Project;

 

(l)                                     comply with the requirements of any commitment or agreement entered into with any Governmental Authority to assist the construction or financing of the Pipeline Project and with the terms of all applicable laws, regulations, and requirements governing such assistance;

 

(m)                               indemnify and hold the Lender harmless from and against all liabilities, claims, damages, reasonable costs, and reasonable expenses (including but not limited to reasonable legal fees and disbursements) relating to or in connection with any third party claims, lawsuits or actions arising out of or resulting from any defective workmanship or materials occurring in the construction of the Pipeline Project.  Upon demand by the Lender, defend any action or proceeding brought against the Lender alleging any defective workmanship or materials, or the Lender may elect to conduct its own defense at the reasonable expense of the Borrower or its subsidiaries or Affiliates.  The provisions of this paragraph will survive the termination of this Agreement and the repayment of the Loans; and

 

(n)                                 obtain and deliver to the Lender copies of all necessary permits, licenses, approvals, and material contracts relating to the Pipeline Project.

 

**IN WITNESS WHEREOF,** the parties have caused this Amended and Restated Fourth Supplement to the Fourth Amended and Restated Master Loan Agreement to be executed by their duly authorized officers as of the date shown above.

 
| **HERON LAKE BIOENERGY, LLC,**a     | **AGSTAR   FINANCIAL SERVICES, PCA** |
|-------------------------------------|--------------------------------------|
| Minnesota limited liability company | an   United States corporation       |
|                                |                                 |
|                                |                                 |
| /s/   Robert J. Ferguson            |                                 | By: | /s/   Mark Schmidt |
| By: Robert J. Ferguson              |                                 | Mark   Schmidt |
| Its: President                      |                                 | Its   Vice President |
|                                     |                                      |  |  |

 

7

----