**Exhibit 10.5**

 

**AMENDMENT NO. 1 TO**

**FOURTH AMENDED AND RESTATED**

**MASTER LOAN AGREEMENT**

 

This Amendment No. 1 to Fourth Amended and Restated Master Loan Agreement dated October 1, 2007 (this “**Amendment**”) is effective as of April 27, 2011, by and between**HERON LAKE BIOENERGY, LLC**, a Minnesota limited liability company (“**Borrower**”), and **AGSTAR FINANCIAL SERVICES, PCA** (“**Lender**”).

 

**RECITALS**

 

A.                                   Lender has extended various credit facilities to Borrower for the purposes of acquiring, constructing, equipping, furnishing and operating an ethanol production facility in Jackson County, Minnesota, pursuant to that certain Fourth Amended and Restated Master Loan Agreement dated as of October 1, 2007, as the same has been amended, supplemented, modified, extended or restated from time to time (the “**MLA**”); that certain Third Supplement to the Master Loan Agreement (Term Loan) dated as of October 1, 2007, as the same has been amended, supplemented, modified, extended or restated from time to time (the “**Third Supplement**”); that certain Fourth Supplement to the Master Loan Agreement (Term Revolving Loan) dated as of October 1, 2007, as the same has been amended, supplemented, modified, extended or restated from time to time (the “**Fourth Supplement**”); and that certain Fifth Supplement to the Master Loan Agreement (Revolving Line of Credit Loan) dated as of November 19, 2007, as the same has been amended, supplemented, modified, extended or restated from time to time (collectively, the “**Fifth Supplement**”).

 

B.                                     Borrower has requested that Lender amend certain provisions of the MLA and Lender has agreed to such amendments upon the terms and conditions set forth herein.

 

C.                                     Unless otherwise expressly defined herein, capitalized terms used herein shall have the same meaning ascribed to them in the MLA.

 

**AGREEMENT**

 

NOW, THEREFORE, in consideration of the premises herein contained, and for other good and valuable consideration, the receipt and sufficiency of which are hereby acknowledged, the parties hereto hereby agree as follows:

 

1.                                       **Amendments to MLA****.**

 

(a)                                  Section 1.01.  The following terms are hereby added or amended, restated and replaced by the following in Section 1.01 of the MLA:

 

“Contractor” means and includes any person or entity, including the General Contractor and any Affiliate of the Borrower, engaged to work on or to furnish materials or supplies for the Project or the Pipeline Project.

 

“Subordination Agreement” means a subordination agreement in a form and substance acceptable to the Lender, pursuant to which any Person, claiming a

 

----

 

Security Interest in any portion of the Pipeline Project located on the Real Property, has agreed to subordinate such interest to the Security Interests of the Lender.

 

“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 as an Exhibit to the Fourth Supplement which identifies the sources and uses of monies in the amount of $3,148,604 for the construction of the Pipeline Project.

 

(b)                                 Section 5.01(s).  The following shall be added as Section 5.01(s) to the MLA:

 

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

 

(i)                                     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;

 

(ii)                                  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;

 

(iii)                               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;

 

(iv)                              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;

 

(v)                                 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

 

2

----

 

Lender’s request, and Borrower must assist Lender or its agents in obtaining such information upon Lender’s request;

 

(vi)                              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;

 

(vii)                           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;

 

(viii)                        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;

 

(ix)                                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 Lender to protect the Lender’s interest and Security Interests in the Collateral should the contest be unsuccessful;

 

(x)                                   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;

 

(xi)                                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

 

3

----

 

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;

 

(xii)                             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;

 

(xiii)                          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

 

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

 

(c)                                  Section 5.02(k).  Section 5.02(k) of the Credit Agreement is amended, restated, and replaced by the following:

 

(k)                                  **Transactions with Affiliates****.**  Directly or indirectly enter into or permit to exist any transaction (including the purchase, sale, lease or exchange of any property or the rendering of any service) with any Affiliate, subsidiary, director, officer or employee of the Borrower, except (i) transactions listed on Schedule 5.02(k), (ii) transactions in the ordinary course of and pursuant to the reasonable requirements of the business of the Borrower or any of its subsidiaries and upon fair and reasonable terms which are fully disclosed to Lender and are no less favorable to the Borrower or such subsidiary than would be obtained in a comparable arm’s length transaction with a Person or entity that is not an Affiliate of the Borrower, (iii) payment of compensation to directors, officers and employees in the ordinary course of business for services actually rendered in their capacities as directors, officers and employees, provided such compensation is reasonable and comparable with compensation paid by companies of like nature and similarly situated, (iv) the formation and capital investment in HLBE Pipeline Company, LLC, a Minnesota limited liability company; and (v) transactions with Agrinatural Gas, LLC, a Delaware limited liability company, which are fully disclosed to Lender and are no less favorable to the Borrower or any of its

 

4

----

 

subsidiaries than would be obtained in a comparable arm’s length transaction with a Person or entity that is not an Affiliate of the Borrower.  Notwithstanding the foregoing, upon the election of Lender, no payments may be made with respect to any items set forth in clauses (i) and (ii) of the preceding sentence upon the occurrence and during the continuation of an Event of Default

 

(d)                                 Section 6.01.  The following subsections shall be added to Section 6.01 of the Credit Agreement is amended, restated, and replaced by the following:

 

(u)                                 Any subsidiary or Affiliate of the Borrower dissolves, suspends, or discontinues doing business which results in a Material Adverse Effect on Borrower; or

 

(v)                                 Construction of the Pipeline Project is halted or abandoned prior to completion for any period of thirty (30) consecutive days for any cause which is not beyond the reasonable control of any contractors and subcontractors, if such halted or abandoned construction could reasonably be expected to have a Material Adverse Effect on the Borrower; or

 

(w)                               The construction of the Pipeline Project shall be delayed for any reason and for such period that, in the reasonable judgment of the Lender, the Pipeline Project will not be completed.  If such delay is curable and if notice of a similar default has not been given by the Lender within the preceding three (3) months, it may be cured (and no Event of Default will have occurred) if such cure is made within thirty (30) days, which shall include advancing the progress of the Pipeline Project to the point that, in the reasonable judgment of the Lender, the Pipeline Project will be completed; or

 

(x)                                   The Borrower or any of its subsidiaries or Affiliates should breach or be in default under a Material Contract in any material respect if, with respect to such breach by any of Borrower’s Affiliates, such breach could reasonably be expected to have a Material Adverse Effect on the Borrower, including any material breach or default, or any termination shall have occurred, or any other event which would permit any party other than the Borrower or its subsidiaries or Affiliates to cause a termination, or any Material Contract shall have ceased for any reason to be in full force and effect prior to its stated or optional expiration date, if, with respect to any of the foregoing by or related to Borrower’s Affiliates, such foregoing events could reasonably be expected to have a Material Adverse Effect on the Borrower.

 

(y)                                 The Borrower or any of its subsidiaries or Affiliates should terminate, change, amend or restate, without the Lender’s prior consent any material contract, or any material construction contract relating to the Pipeline Project if, with respect to Borrower’s Affiliates, such termination, change, amendment or restatement could reasonably be expected to have a Material Adverse Effect on the Borrower.

 

5

----

 

2.                                       **Conditions Precedent to Effectiveness of this Amendment**. The obligations of the Lender hereunder are subject to the conditions precedent that the Lender shall have received the following, in form and substance satisfactory to the Lender:

 

a.                                       this Amendment duly executed by the Borrower and the Lender;

 

b.                                      the Third Amendment to Forbearance Agreement duly executed by the Borrower and the Lender;

 

c.                                       the Amended and Restated Fourth Supplement to the Master Loan Agreement duly executed by the Borrower and the Lender;

 

d.                                      the Amendment No. 2 to Amended and Restated Fifth Supplement to the Master Loan Agreement duly executed by the Borrower and the Lender;

 

e.                                       the Allonge No. 2 to the Revolving Line of Credit Note duly executed by the Borrower and the Lender;

 

f.                                         the Pledge Agreement duly executed by the Borrower;

 

g.                                      the Guaranty and Pledged Agreement duly executed by HLBE Pipeline Company, LLC; and

 

h.                                      payment of all of Lender’s costs, fees and expenses incurred in connection with the drafting and negotiation of this Amendment and the transactions contemplated hereunder, including without limitation all legal fees incurred by the Lender in connection with the negotiation, preparation, review and execution of this Amendment and the documents relating hereto.

 

3.                                       **Representations and Warranties of Borrower**.  The Borrower hereby agrees with, reaffirms, and acknowledges as follows:

 

a.                                       The execution, delivery and performance by Borrower of this Amendment is within Borrower’s power, has been duly authorized by all necessary action, and does not contravene:  (i) its articles of organization or operating agreement; or (ii) any law or any contractual restriction binding on or affecting Borrower; and does not result in or require the creation of any lien, security interest or other charge or encumbrance upon or with respect to any of its properties;

 

b.                                      This Amendment is, and each other Loan Document to which Borrower is a party when delivered will be, legal, valid and binding obligations of Borrower enforceable against Borrower in accordance with their respective terms, except as may be limited by applicable bankruptcy, insolvency, reorganization, moratorium, or similar laws affecting the enforcement of creditor’s rights generally and by general principles of equity; and

 

c.                                       All other representations, warranties and covenants contained in the MLA and the other Loan Documents are true and correct and in full force and effect.

 

6

----

 

4.                                       **Miscellaneous****.**

 

a.                                       Effect; Ratification.  The amendments set forth herein are effective solely for the purposes set forth herein and shall be limited precisely as written, and shall not be deemed to (i) be a consent to, or an acknowledgment of, any amendment, waiver or modification of any other term or condition of the MLA or any other Loan Document, including, without limitation, a waiver of any rights or remedies available to the Lender on account of any default or Event of Default, which may have occurred prior to the date of this Amendment, or (ii) prejudice any right or remedy which Lender may now have or may have in the future under or in connection with the MLA, as amended hereby, or any other instrument or agreement referred to therein. It is further understood and agreed by and between the Borrower and the Lender that all other terms and provisions of the MLA and the other Loan Documents shall remain in full force and effect, enforceable by the Lender against the Borrower as fully as though no amendments had been made hereby, and this Amendment shall not be deemed to hinder, compromise or lessen the enforceability of the MLA, the other Loan Documents, the Notes, or any mortgage, security interest, or guaranty securing repayment of the Loans, in any way.  Each reference in the MLA and in any other Loan Document to the “MLA” shall mean the MLA, as amended hereby.

 

b.                                      Loan Documents.  This Amendment is a Loan Document executed pursuant to the MLA and shall be construed, administered and applied in accordance with the terms and provisions thereof.

 

c.                                       Defined Terms.** **All terms used and not otherwise defined herein shall have the meanings assigned to them in the MLA.

 

d.                                      Counterparts.  This Amendment may be executed in any number of counterparts, each such counterpart constituting an original and all of which when taken together shall constitute one and the same instrument.

 

e.                                       Severability.  Any provision contained in this Amendment which is held to be inoperative, unenforceable or invalid in any jurisdiction shall, as to that jurisdiction, be inoperative, unenforceable or invalid without affecting the remaining provisions of this Amendment in that jurisdiction or the operation, enforceability or validity of such provision in any other jurisdiction.

 

f.                                         GOVERNING LAW.  THIS AMENDMENT SHALL BE GOVERNED AND CONSTRUED IN ACCORDANCE WITH THE LAWS OF THE STATE OF MINNESOTA.

 

g.                                      WAIVER OF JURY TRIAL.  THE BORROWER AND THE LENDER HEREBY IRREVOCABLY WAIVE ALL RIGHTS TO TRIAL BY JURY IN ANY ACTION, PROCEEDING OR COUNTERCLAIM ARISING OUT OF OR RELATING TO ANY LOAN DOCUMENT TO WHICH IT IS A PARTY OR ANY INSTRUMENT OR DOCUMENT DELIVERED THEREUNDER.

 

{SIGNATURE PAGE FOLLOWS}

 

7

----

 

**SIGNATURE PAGE TO**

**AMENDMENT NO. 1 TO**

**FOURTH AMENDED AND RESTATED MASTER LOAN AGREEMENT**

**BY AND BETWEEN**

**HERON LAKE BIOENERGY, LLC**

**AND**

**AGSTAR FINANCIAL SERVICES, PCA**

**DATED AS OF:  April 27, 2011**

 

IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be executed and delivered by their respective duly authorized officers as of the date first written above.

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

 

8

----