EXHIBIT 10.4 FOURTH AMENDMENT THIS FOURTH AMENDMENT (this "Fourth Amendment") dated as of January 30, 1998 is to the Credit Agreement (the "Credit Agreement") dated as of September 15, 1995 between TETRA TECH, INC. (the "Company") and BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION (successor in interest by merger to Bank of America Illinois) (the "Bank"). Unless otherwise defined herein, terms defined in the Credit Agreement are used herein as defined therein. WHEREAS, the parties hereto have entered into the Credit Agreement which provides for the Bank to make Loans to, and to issue Letters of Credit for the account of, the Company from time to time; and WHEREAS, the parties hereto desire to amend the Credit Agreement as set forth below; NOW, THEREFORE, in consideration of the premises and for other good and valuable consideration (the receipt and sufficiency of which are hereby acknowledged), the parties hereto agree as follows: SECTION 1 AMENDMENTS. Effective on (and subject to the occurrence of) the Fourth Amendment Effective Date (as defined below), the Credit Agreement shall be amended as follows: SECTION 1.1 SECTION 2.1. Section 2.1 of the Credit Agreement is amended by deleting the amount "$45,000,000" therein and substituting the amount "$55,000,000" therefor. SECTION 1.2 EXHIBIT A. Exhibit A to the Credit Agreement is hereby amended in its entirety to read in the form of EXHIBIT A hereto. SECTION 2 REPRESENTATIONS AND WARRANTIES. The Company represents and warrants to the Bank that (a) each warranty set forth in Section 9 of the Credit Agreement is true and correct as if made on the date hereof, (b) the execution and delivery by the Company of this Fourth Amendment and the New Note (as defined below), and the performance by the Company of its obligations under the Credit Agreement as amended hereby (as so amended, the "Amended Credit Agreement") and the New Note (i) are within the corporate powers of the Company and each Subsidiary, (ii) have been duly authorized by all necessary corporate action, (iii) have received all necessary governmental approval and (iv) do not and will not contravene or conflict with any provision of law or of the charter or by-laws of the Company or any Subsidiary or of any indenture, loan agreement or other material contract, order or decree which is binding upon the Company or any Subsidiary, and (c) this Fourth Amendment, the Amended Credit Agreement, and the New Note are the legal, valid and binding obligations of the Company and each Subsidiary which is party hereto, enforceable against the Company and each Subsidiary in accordance with their terms, except as enforceability may be limited by bankruptcy, insolvency or other similar laws of general 1 application affecting the enforcement of creditor's rights or by general principles of equity limiting the availability of equitable remedies. SECTION 3 EFFECTIVENESS. The amendments set forth in SECTION 1 shall become effective, as of the day and year first above written, on such date (the "Fourth Amendment Effective Date") that the Bank shall have received (i) an amendment fee of $10,000, (ii) counterparts of this Fourth Amendment executed by the parties hereto and (iii) each of the following documents in form and substance satisfactory to the Bank: (a) RESOLUTIONS OF COMPANY. Certified copies of resolutions of the Board of Directors of the Company authorizing the execution and delivery of this Fourth Amendment and the performance of its obligations under the Amended Credit Agreement. (b) INCUMBENCY AND SIGNATURE CERTIFICATE OF COMPANY. A certificate of the Secretary or the Assistant Secretary of the Company certifying the names and true signatures of the officers of the Company authorized to execute, deliver and perform, as applicable, this Fourth Amendment and all other documents to be executed in connection therewith. (c) NEW NOTE. A promissory note of the Company (the "New Note") in the form of EXHIBIT A hereto. (d) OPINION. The opinion of Riordan & McKinzie, counsel to the Company and its Subsidiaries, in form and substance satisfactory to the Bank SECTION 4 MISCELLANEOUS. SECTION 4.1 CONTINUING EFFECTIVENESS, ETC. As herein amended, the Credit Agreement shall remain in full force and effect and is hereby ratified and confirmed in all respects. SECTION 4.2 COUNTERPARTS. This Fourth Amendment may be executed in any number of counterparts and by the different parties on separate counterparts, and each such counterpart shall be deemed to be an original but all such counterparts shall together constitute one and the same Fourth Amendment. SECTION 4.3 GOVERNING LAW. This Fourth Amendment shall be a contract made under and governed by the internal laws of the State of Illinois. SECTION 4.4 SUCCESSORS AND ASSIGNS. This Fourth Amendment shall be binding upon the Company and the Bank and their respective successors and assigns, and shall inure to the benefit of the Company and the Bank and the successors and assigns of the Bank. 2 Delivered at Chicago, Illinois, as of the day and year first above written. TETRA TECH, INC. By /s/ Richard A. Lemmon -------------------------------- Title Secretary -------------------------------- BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION By: -------------------------------- Title: -------------------------------- 3 Each of the undersigned hereby acknowledges and agrees to the foregoing Fourth Amendment and the Amended Credit Agreement and hereby confirms the continuing effectiveness of the Guaranty and the Security Agreement with respect to the Amended Credit Agreement. HSI GEOTRANS, INC. By: /s/ Richard A. Lemmon -------------------------------- Title: Assistant Secretary -------------------------------- SIMONS, LI & ASSOCIATES, INC. By: /s/ Richard A. Lemmon -------------------------------- Title: Secretary -------------------------------- TETRA TECH EM, INC. By: /s/ Richard A. Lemmon -------------------------------- Title: Secretary -------------------------------- WHALEN & COMPANY, INC. By: /s/ Richard A. Lemmon -------------------------------- Title: Secretary -------------------------------- TETRA TECH NUS, INC. By: /s/ Richard A. Lemmon -------------------------------- Title: Secretary -------------------------------- 4 EXHIBIT A FORM OF NOTE $55,000,000 January 30, 1998 Chicago, Illinois The undersigned, for value received, promises to pay to the order of BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, a national banking association having an office at 231 South LaSalle Street, Chicago, Illinois (the "Bank") at the principal office of the Bank in Chicago, Illinois, FIFTY-FIVE MILLION DOLLARS or, if less, the aggregate unpaid amount of all Loans made by the undersigned pursuant to the Credit Agreement referred to below (as shown on the schedule attached hereto (and any continuation thereof) or in the records of the Bank), such principal amount to be payable in installments as set forth in the Credit Agreement. The undersigned further promises to pay interest on the unpaid principal amount of each Loan from the date of such Loan until such Loan is paid in full, payable at the rate(s) and at the time(s) set forth in the Credit Agreement. Payments of both principal and interest are to be made in lawful money of the United States of America. This Note evidences indebtedness incurred under, and is subject to the terms and provisions of, the Credit Agreement, dated as of September 15, 1995 (as amended or otherwise modified from time to time, the "Credit Agreement"; terms not otherwise defined herein are used herein as defined in the Credit Agreement), between the undersigned and the Bank, to which Credit Agreement reference is hereby made for a statement of the terms and provisions under which this Note may or must be paid prior to its due date or its due date accelerated. In addition to and not in limitation of the foregoing and the provisions of the Credit Agreement, the undersigned further agrees, subject only to any limitation imposed by applicable law, to pay all expenses, including reasonable attorneys' fees and legal expenses, incurred by the holder of this Note in endeavoring to collect any amounts payable hereunder which are not paid when due, whether by acceleration or otherwise. This Note is made under and governed by the internal laws of the State of Illinois. TETRA TECH, INC. By: /s/ Richard A. Lemmon -------------------------------- Title: Secretary -------------------------------- 5 Schedule Attached to Note dated January 30, 1998 of TETRA TECH, INC. payable to the order of BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION. Date and Date and Amount of Amount of Loan or of Repayment or of Interest Conversion from Conversion into Period/ Unpaid another type of another type of Maturity Principal Notation Loan Loan Date Balance Made by 1. FLOATING RATE LOANS _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ 2. EURODOLLAR LOANS _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ _______________________________________________________________________________ 6