Exhibit 10.4(a)

Execution Version

FIRST AMENDMENT TO FOURTH AMENDED AND RESTATED REVOLVING CREDIT

AND SECURITY AGREEMENT

This First Amendment to Fourth Amended and Restated Revolving Credit and
Security Agreement (the “Amendment”) is made this 29th day of August, 2017 by
and among Green Plains Trade Group LLC, a limited liability company formed under
the laws of the State of Delaware (“GTRADE”), and each Person joined as a
Borrower from time to time (each a “Borrower”, and collectively “Borrowers”),
the financial institutions which are now or which hereafter become a party
hereto (collectively, the “Lenders” and each individually a “Lender”) and PNC
BANK, NATIONAL ASSOCIATION (“PNC”), as agent for Lenders (PNC, in such capacity,
the “Agent”).

BACKGROUND

A. On July 28, 2017, Borrower, Lenders and Agent entered into that certain
Fourth Amended and Restated Revolving Credit and Security Agreement (as same has
been or may be amended, modified, renewed, extended, replaced or substituted
from time to time, the “Loan Agreement”) to reflect certain financing
arrangements between the parties thereto. The Loan Agreement and all other
documents executed in connection therewith to the date hereof are collectively
referred to as the “Existing Financing Agreements.” All capitalized terms not
otherwise defined herein shall have the meaning ascribed thereto in the Loan
Agreement.

B. Borrower has requested that Agent and Lenders amend certain provisions of the
Loan Agreement, and Agent and Lenders are willing to do so on the terms and
conditions hereafter set forth.

NOW THEREFORE, with the foregoing background hereinafter deemed incorporated by
reference herein and made part hereof, the parties hereto, intending to be
legally bound, promise and agree as follows:

1. Amendments to Loan Agreement. On the Effective Date, the Loan Agreement is
amended as follows:

(a) New Definitions. The following new definitions are hereby added to
Section 1.2 of the Loan Agreement in alphabetical order as follows:

“ABL Intercreditor Agreement” shall mean that certain ABL Intercreditor
Agreement among BNP Paribas, as term loan collateral agent and PNC Bank,
National Association, as ABL Collateral Agent, acknowledged and agreed by
Borrower dated August 29, 2017.

“ABL Trade Guarantors” shall mean Green Plains Inc., Green Plains I LLC, Green
Plains II LLC, Fleischmann’s Vinegar Company, Inc., Green Plains Agriculture and
Energy Fund LLC, Green Plains Asset Management LLC, Green Plains Grain

--------------------------------------------------------------------------------

Company TN LLC, Green Plains Industrial Cleaning Services LLC, Green Plains
Trucking LLC, Green Plains Hereford LLC, Green Plains Hopewell LLC, Green Plains
Madison LLC, Green Plains Mount Vernon LLC, Green Plains York LLC, Green Plains
Atkinson LLC, Green Plains Bluffton LLC, Green Plains Central City LLC, Green
Plains Commodities LLC, Green Plains Corn Oil LLC, Green Plains Fairmont LLC,
Green Plains Holdings II LLC, Green Plains Obion LLC, Green Plains Ord LLC,
Green Plains Otter Tail LLC, Green Plains Shenandoah LLC, Green Plains Superior
LLC and Green Plains Wood River LLC.

“ABL Trade Guaranty” shall mean those certain Guaranty Agreements executed by
each ABL Trade Guarantor in favor of Agent for the benefit of Lenders dated
August 29, 2017.

“ABL Trade Guarantor Security Agreement” shall mean that certain Security
Agreement executed by each ABL Trade Guarantor in favor of Agent for the benefit
of Lenders dated August 29, 2017.

“Cattle Credit Agreement” shall mean that certain Credit Agreement among Green
Plains Cattle Company LLC, a Delaware limited liability company, Bank of the
West and ING Capital LLC, and holders of the debt dated December 3, 2014 (as
amended, restated, amended and restated, supplemented or otherwise modified from
time to time).

“Grain Credit Agreement” shall mean that certain Credit Agreement among Green
Plains Grain Company LLC, a Delaware limited liability company, BNP Paribas, and
holders of the debt dated October 28, 2011 (as amended, restated, amended and
restated, supplemented or otherwise modified from time to time).

“Mortgage” means a mortgage, deed of trust, leasehold mortgage or similar
instrument granting Agent for the benefit of the Lenders a Lien on real property
owned or leased by the Borrower or any Guarantor.

“Term Loan Agreement” shall mean that certain Term Loan Agreement among Green
Plains Inc., a Delaware corporation, BNP Paribas, and holders of the debt dated
August 29, 2017 (as amended, restated, amended and restated, supplemented or
otherwise modified from time to time).

“Term Loan Documents” shall mean the Term Loan Agreement and the other
agreements, instruments and documents executed in connection therewith.

 

2

--------------------------------------------------------------------------------

“Term Loan Guaranty” shall mean that certain Guaranty by GPTG and certain
Affiliates in favor of the Term Loan Holders dated August 29, 2017.

“Term Loan Holders” shall mean BNP Paribas and each of the holders of
Indebtedness under the Term Loan Agreement.

“Term Loan Intercreditor Agreement” shall mean that certain Term Loan
Intercreditor and Collateral Agency Agreement among BNP Paribas, as term loan
collateral agent, PNC Bank, National Association, as Pari Passu Collateral
Agent, Bank of the West and ING Capital LLC, as ABL-Cattle Agent, BNP Paribas,
as ABL-Grain Agent and PNC Bank, National Association, as ABL-Trade Agent,
acknowledged and agreed to by Green Plains Inc. and the other grantors
identified therein dated August 29, 2017.

“Term Loan Security Agreement” shall mean that certain Security Agreement
between GPTG and certain Affiliates and the Term Loan Holders dated August 29,
2017.

(b) Definitions. The following definitions contained in Section 1.2 of the Loan
Agreement are hereby amended and restated in their entirety as follows:

“Other Documents” shall mean, the Notes, the Perfection Certificates, any
Guaranty (including the ABL Trade Guaranty), any Guarantor Security Agreement
(including the ABL Trade Guarantor Security Agreement), any Pledge Agreement,
any Lender-Provided Interest Rate Hedge, the Fee Letter, the Term Loan
Intercreditor Agreement, the ABL Intercreditor Agreement and any and all other
agreements, instruments and documents, including intercreditor agreements,
guaranties, pledges, powers of attorney, consents, interest or currency swap
agreements or other similar agreements and all other writings heretofore, now or
hereafter executed by any Borrower or any Guarantor and/or delivered to Agent or
any Lender in respect of the transactions contemplated by this Agreement, in
each case together with all extensions, renewals, amendments, supplements,
modifications, substitutions and replacements thereto and thereof.

“Permitted Encumbrances” shall mean: (a) Liens in favor of Agent for the benefit
of Agent and Lenders; (b) Liens for taxes, assessments or other governmental
charges not delinquent or being Properly Contested; (c) Reserved; (d) deposits
or pledges to secure

 

3

--------------------------------------------------------------------------------

obligations under worker’s compensation, social security or similar laws, or
under unemployment insurance; (e) deposits or pledges to secure bids, tenders,
contracts (other than contracts for the payment of money), leases, statutory
obligations, surety and appeal bonds and other obligations of like nature
arising in the Ordinary Course of Business; (f) Liens arising by virtue of the
rendition, entry or issuance against any Borrower or any Subsidiary, or any
property of any Borrower or any Subsidiary, of any judgment, writ, order, or
decree for so long as each such Lien (x) is in existence for less than 20
consecutive days after it first arises or is being Properly Contested and (y) is
at all times junior in priority to any Liens in favor of Agent; (g) mechanics’,
workers’, materialmen’s or other like Liens arising in the Ordinary Course of
Business with respect to obligations which are not due or which are being
Properly Contested; (h) Liens placed upon fixed assets hereafter acquired to
secure a portion of the purchase price thereof, provided that (x) any such lien
shall not encumber any other property of any Borrower and (y) the aggregate
amount of Indebtedness secured by such Liens incurred as a result of such
purchases during any fiscal year shall not exceed the amount provided for in
Section 7.6; (i) other Liens incidental to the conduct of any Borrower’s
business or the ownership of its property and assets which were not incurred in
connection with the borrowing of money or the obtaining of advances or credit so
long as such Lien is junior in priority to any Liens in favor of Agent, and
which do not in the aggregate materially detract from Agent’s or Lenders’ rights
in and to the Collateral or the value of any Borrower’s property or assets and
which do not materially impair the use thereof in the operation of any
Borrower’s business; (j) Liens disclosed on Schedule 1.2 and (k) Liens granted
to Term Loan Holders pursuant to the Term Loan Security Agreement, subject to
the terms of, the ABL Intercreditor Agreement and the Term Loan Intercreditor
Agreement.

(c) Guarantees. Section 7.3 of the Loan Agreement is hereby amended and restated
in its entirety as follows:

7.3 Guarantees. Become liable upon the obligations or liabilities of any Person
by assumption, endorsement or guaranty thereof or otherwise (other than to
Lenders) except (i) the endorsement of checks in the Ordinary Course of Business
and (ii) pursuant to the Term Loan Guaranty, subject to the terms of, the Term
Loan Intercreditor Agreement and the ABL Intercreditor Agreement.

(d) Indebtedness. Section 7.8 of the Loan Agreement is hereby amended and
restated in its entirety as follows:

 

4

--------------------------------------------------------------------------------

7.8. Indebtedness. Create, incur, assume or suffer to exist any Indebtedness
(exclusive of trade debt) except in respect of (i) Indebtedness to Lenders,
(ii) Indebtedness incurred for Capital Expenditures permitted under Section 7.6
hereof, (iii) unsecured Subordinated Debt, so long as (a) no Default or Event of
Default has occurred or would occur after giving effect to the incurrence of
such Indebtedness, (b) receipt by Agent of written notice five (5) days prior to
the incurrence of such Indebtedness, (c) such Indebtedness is made on terms and
conditions reasonably acceptable to Agent and (d) Agent has received an executed
Subordination Agreement, (iv) Indebtedness in an amount not to exceed
$50,000,000 at any time secured by Eligible Un-Insured Foreign Receivables and
Eligible Insured Foreign Receivable so long as such Indebtedness (a) is subject
to documentation reasonably acceptable to Agent, (b) does not include
Receivables to the extent Advances were made with respect to such Receivables as
a component of a Borrowing Base hereunder and such Advances still remain
outstanding and (c) no Default or Event of Default has occurred or would occur
after giving effect to the incurrence of such Indebtedness; (v) Indebtedness in
respect of Repurchase Facilities for portions of Natural Gas Inventory,
Commingled Ethanol Inventory and Crude Oil Inventory in an amount not to exceed
$50,000,000 at any time, so long as such Repurchase Facilities (a) are subject
to documentation reasonably acceptable to Agent, (b) do not include Inventory to
the extent Advances were made with respect to such Inventory as a component of a
Borrowing Base hereunder and such Advances still remain outstanding and (c) no
Default or Event of Default has occurred or would occur after giving effect to
the incurrence of such Indebtedness and (vi) Indebtedness related to the Term
Loan Guaranty, subject to the terms of, the Term Loan Intercreditor Agreement
and the ABL Intercreditor Agreement.

(e) Lien Priority. The following Section 10.11 of the Loan Agreement is hereby
amended and restated as follows:

10.11. Lien Priority. Any Lien created hereunder or provided for hereby or under
any related agreement for any reason ceases to be or is not a valid and
perfected Lien having a first priority interest (or having a second priority
interest to the extent set forth in the Term Loan Intercreditor Agreement);

(f) Events of Default. The following Section 10.24 “Term Loan/ABL Cross-Default”
is hereby added to the Loan Agreement as follows:

10.24. Term Loan/ABL Cross-Default. (i) an event of default has occurred and is
continuing under the Term Loan Agreement, the

 

5

--------------------------------------------------------------------------------

Cattle Credit Agreement, the Grain Credit Agreement, the ABL Intercreditor
Agreement or the Term Loan Intercreditor Agreement (and all cure periods have
concluded) (ii) any party to the ABL Intercreditor Agreement or the Term Loan
Intercreditor Agreement (other than Agent in its applicable capacity thereunder)
attempts to terminate, challenges the validity of, or its obligations under,
such agreement, or (iii) the ABL Intercreditor Agreement or the Term Loan
Intercreditor Agreement shall cease to be in full force and effect.

(g) Post Closing Real Estate Deliverables. Borrowers shall cause the ABL Trade
Guarantors to deliver to Agent within 120 days of the Effective Date (or such
longer period as to which Agent may agree in its sole discretion) with respect
to the fee interests in Real Property set forth on Schedule I attached hereto,
Mortgages duly executed by the appropriate ABL Trade Guarantor, together with:

 

  (i) evidence that counterparts of the Mortgages have been duly executed,
acknowledged and delivered and are in form and substance reasonably acceptable
to Agent and otherwise suitable for filing or recording in all filing or
recording offices that Agent may deem reasonably necessary or desirable in order
to create a valid second and subsisting Lien on the property described therein
in favor of Agent for the benefit of the Lenders and that all filing,
documentary, stamp, intangible and recording taxes and fees have been paid;

 

  (ii) (i) for each of the properties described in the Mortgages, a commitment
for an American Land Title Association (“ALTA”) Loan Title Insurance Policy,
2006 (or the equivalent thereof; each a “Title Commitment”), issued by an
insurer reasonably acceptable to Agent, insuring Agent’s Lien on such property,
which policy shall be in an amount not less than 100% of the reasonably
estimated fair market value of such property and shall contain customary
endorsements and exceptions to coverage reasonably acceptable to Agent;
(ii) copies of all material documents of record concerning such property as
shown on the title insurance commitment referred to above; and (iii) customary
flood searches together with such other information and documents in each case
conforming with and sufficient to demonstrate compliance with the Flood Laws
relative to each such property, and if indicated by such searches, a flood
insurance policy covering such property which policy shall comply with
applicable law and shall otherwise be reasonably acceptable to Agent, or
confirmation that such a policy is not required by applicable law;

 

  (iii) an ALTA/National Society of Professional Surveyors (or, to the extent
agreed to by Agent in its reasonable discretion, ALTA/America Congress on
Surveying and Mapping) survey for each of the properties described in the
Mortgages, reasonably acceptable to Agent, for which all necessary fees (where
applicable) have been paid, performed by a land surveyor reasonably acceptable
to Agent; provided that, upon the request of the Borrowers and if agreed to by
Agent in its reasonable discretion, this delivery may be satisfied by a tract
map, plat map or other depiction of a property described in a Mortgage;

 

6

--------------------------------------------------------------------------------

  (iv) a Phase I Environmental Site Assessment, which in each case is reasonably
satisfactory to Agent, as to each of the properties described in the Mortgages,
from professional firms acceptable to Agent;

 

  (v) evidence of the insurance required by the terms of Section 4.11 of the
Loan Agreement and the flood insurance information and documents and evidence of
flood insurance required by the terms of Section 4.21 of the Loan Agreement;

 

  (vi) evidence that all other action that Agent may deem reasonably necessary
or desirable in order to create valid second and subsisting Liens on the
property described in the Mortgages has been taken;

 

  (vii) a loan policy of title insurance for each Mortgage, incorporating the
comments of Agent to the related Title Commitment, if applicable, insuring that
a valid second and subsisting Lien on the property described in the Mortgage has
been taken, including a reading by the title insurer of the related survey, and
containing such customary endorsements thereto as Agent shall reasonably
require;

 

  (viii) an environmental indemnity agreement executed and delivered by each
Borrower and each ABL Trade Guarantor applicable to the real property encumbered
by the Mortgages, in form and substance reasonably acceptable to Agent
(provided, that this requirement may be satisfied by the environmental indemnity
agreement delivered on the Effective Date to the extent applicable to each such
real property);

 

  (ix) in the case of any leasehold Mortgage, (a) a copy of the underlying lease
(the “Ground Lease”), (b) evidence that a copy of, or a memorandum of, the
Ground Lease has been recorded against the related real property, (c) a landlord
consent and estoppel, in form and substance reasonably acceptable to Agent, and
(d) if applicable, a fee mortgagee consent and estoppel, in form and substance
reasonably acceptable to Agent; and

 

  (x) such other documents related to interests in such real property held by
the ABL Trade Guarantors as Agent may reasonably require.

2. Representations and Warranties of Borrowers. Each Borrower hereby:

(a) reaffirms all representations and warranties made to Agent and Lenders under
the Loan Agreement and all of the other Existing Financing Agreements and
confirms that all are true and correct in all material respects as of the date
hereof (except to the extent any such representations and warranties
specifically relate to a specific date, in which case such representations and
warranties were true and correct in all material respects on and as of such
other specific date);

(b) reaffirms all of the covenants contained in the Loan Agreement (as amended
hereby), covenants to abide thereby until all Advances, Obligations and other
liabilities of Borrowers to Agent and Lenders under the Loan Agreement of
whatever nature and whenever incurred, are satisfied and/or released by Agent
and Lenders;

 

7

--------------------------------------------------------------------------------

(c) represents and warrants that no Default or Event of Default has occurred and
is continuing under any of the Existing Financing Agreements;

(d) represents and warrants that it has the authority and legal right to
execute, deliver and carry out the terms of this Amendment, that such actions
were duly authorized by all necessary limited liability company or corporate
action, as applicable, and that the officers executing this Amendment on its
behalf were similarly authorized and empowered, and that this Amendment does not
contravene any provisions of its certificate of incorporation or formation,
operating agreement, bylaws, or other formation documents, as applicable, or of
any contract or agreement to which it is a party or by which any of its
properties are bound; and

(e) represents and warrants that this Amendment and all assignments,
instruments, documents, and agreements executed and delivered in connection
herewith, are valid, binding and enforceable in accordance with their respective
terms, except as such enforceability may be limited by any applicable
bankruptcy, insolvency, moratorium or similar laws affecting creditors’ rights
generally.

3. Conditions Precedent/Effectiveness Conditions. This Amendment shall be
effective upon the date of satisfaction of the following conditions precedent
(“Effective Date”) (all documents to be in form and substance reasonably
satisfactory to Agent and Agent’s counsel):

(a) Agent shall have received this Amendment fully executed by the Borrowers and
Guarantor;

(b) Agent shall have received the fully executed ABL Trade Guaranty, ABL Trade
Guarantor Security Agreement, the ABL Intercreditor Agreement and the Term Loan
Intercreditor Agreement;

(c) Agent shall have received fully executed copies of the Term Loan Documents;

(d) Agent shall have received such other agreements, documents or information as
requested by Agent in its reasonable discretion.

4. Further Assurances. Each Borrower hereby agrees to take all such actions and
to execute and/or deliver to Agent and Lenders all such documents, assignments,
financing statements and other documents, as Agent and Lenders may reasonably
require from time to time, to effectuate and implement the terms of this
Amendment.

5. Payment of Expenses. Borrowers shall pay or reimburse Agent and Lenders for
its reasonable attorneys’ fees and expenses in connection with the preparation,
negotiation and execution of this Amendment and the documents provided for
herein or related hereto.

 

8

--------------------------------------------------------------------------------

6. Reaffirmation of Loan Agreement. Except as modified by the terms hereof, all
of the terms and conditions of the Loan Agreement, as amended, and all other of
the Existing Financing Agreements are hereby reaffirmed and shall continue in
full force and effect as therein written.

7. Confirmation of Indebtedness. Borrowers confirm and acknowledge that as of
the close of business on August 24, 2017, Borrowers were indebted to Agent and
Lenders for the Advances under the Loan Agreement without any deduction,
defense, setoff, claim or counterclaim, of any nature, in the aggregate
principal amount of $111,228,105.54, consisting of (i) $100,042,224.13 on
account of Revolving Advances, $11,185,881.41 on account of FILO Advances and $0
on account of undrawn Letters of Credit, plus all fees, costs and expenses
incurred to date in connection with the Loan Agreement and the Other Documents.

8. Acknowledgment of Guarantors. By execution of this Amendment, Green Plains
Inc., formerly known as Green Plains Renewable Energy, Inc., hereby covenants
and agrees that its Fourth Amended and Restated Limited Guaranty and Suretyship
Agreement dated July 28, 2017 shall remain in full force and effect and shall
continue to cover the existing and future Obligations of Borrowers to Agent and
Lenders.

9. Miscellaneous.

(a) Third Party Rights. No rights are intended to be created hereunder for the
benefit of any third party donee, creditor, or incidental beneficiary.

(b) Headings. The headings of any paragraph of this Amendment are for
convenience only and shall not be used to interpret any provision hereof.

(c) Modifications. No modification hereof or any agreement referred to herein
shall be binding or enforceable unless in writing and signed on behalf of the
party against whom enforcement is sought.

(d) Governing Law. The terms and conditions of this Amendment and all matters
relating hereto or thereto or arising herefrom (whether arising under contract
law, tort law or otherwise) shall, in accordance with Section 5-1401 of the
General Obligations Law of the State of New York, be governed by and construed
in accordance with the laws of the State of New York.

(e) Counterparts. This Amendment may be executed in any number of and by
different parties hereto on separate counterparts, all of which, when so
executed, shall be deemed an original, but all such counterparts shall
constitute one and the same agreement. Any signature delivered by a party by
facsimile or pdf transmission shall be deemed to be an original signature
hereto.

 

9

--------------------------------------------------------------------------------

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

 

GREEN PLAINS TRADE GROUP LLC, as Borrower

By:   /s/ Michelle Mapes Name:    Michelle Mapes Title:  

EVP - General Counsel & Corp.  Secretary

GREEN PLAINS INC., as Guarantor

By:   /s/ Michelle Mapes Name:    Michelle Mapes Title:  

EVP - General Counsel & Corp.  Secretary

PNC BANK, NATIONAL ASSOCIATION, as Lender and as Agent

By:   /s/ Lee Labine Name:    Lee Labine Title:   Senior Vice President

CITIBANK, N.A., as a Lender

By:   /s/ Jeff Royston Name:    Jeff Royston Title:   Senior Vice President

BMO HARRIS BANK N.A., as a Lender

By:   /s/ Terrence McKenna Name:    Terrence McKenna Title:   Vice President

 

[SIGNATURE PAGE TO FIRST AMENDMENT TO

FOURTH AMENDED AND RESTATED REVOLVING CREDIT AND SECURITY AGREEMENT]

--------------------------------------------------------------------------------

FIRST TENNESSEE BANK NATIONAL ASSOCIATION, as a Lender

By:   /s/ Jim Norvell Name:    Jim Norvell Title:   Senior Vice President

WOODFOREST NATIONAL BANK, as a Lender

By:   /s/ Dennis Kujawa Name:    Dennis Kujawa Title:   First Vice President

BANK OF AMERICA,

as a Lender

By:   /s/ Charles Fairchild Name:    Charles Fairchild Title:   Vice President

 

[SIGNATURE PAGE TO FIRST AMENDMENT TO

FOURTH AMENDED AND RESTATED REVOLVING CREDIT AND SECURITY AGREEMENT]