Exhibit 10.18 EXECUTION COPY SECOND AMENDMENT TO THE CREDIT AGREEMENT Dated as of July 12, 2004 SECOND AMENDMENT TO THE CREDIT AGREEMENT (this "AMENDMENT") among BUILDING MATERIALS CORPORATION OF AMERICA, a Delaware corporation (the "COMPANY"), each other grantor party to the Security Agreement referred to below (the "GRANTORS"), the undersigned banks, financial institutions and other institutional lenders party hereto (collectively, the "LENDERS" and each a "LENDER"), and CITICORP USA, INC., as collateral monitoring agent and administrative agent for the Lenders (the "ADMINISTRATIVE AGENT"). PRELIMINARY STATEMENTS: (1) Reference is made to the Credit Agreement, dated as of July 9, 2003 (as amended by the First Amendment to the Credit Agreement, dated as of May 7, 2004, and as otherwise amended, supplemented or otherwise modified through the date hereof, the "CREDIT AGREEMENT"), among the Company, the lenders from time to time party thereto, the Administrative Agent and Citigroup Global Markets Inc., as lead arranger. Terms defined in the Credit Agreement and not otherwise defined herein are used in this Amendment as defined in the Credit Agreement. (2) Reference is made to the Indenture, dated as of December 9, 1996, between the Company and The Bank of New York, as trustee (the "2006 TRUSTEE"), pursuant to which 8 5/8% senior notes due 2006 (the "2006 SENIOR NOTES") were issued, as supplemented by Supplements dated as of January 1, 1999 and December 4, 2000 (the "2006 INDENTURE"). (3) The Company intends to issue up to $150 million of senior notes due 2011 or 2014, at the election of the Company (the "NEW SENIOR NOTES") pursuant to an indenture (the "NEW INDENTURE") to be entered into by the Company and a trustee to be determined by the Company, as trustee (the "NEW TRUSTEE"), and to apply the proceeds from the sale of the New Senior Notes (x) to redeem all of the 2006 Senior Notes (including accrued and unpaid interest on such 2006 Senior Notes), (y) to pay fees and expenses in connection with the offering of the New Senior Notes (the "TRANSACTION COSTS") and (z) to finance the general corporate purposes of the Company and its Subsidiaries. The principal amount of the 2006 Senior Notes outstanding on the redemption date of the 2006 Senior Notes immediately prior to the issuance of the New Senior Notes plus the accrued and unpaid interest on such 2006 Senior Notes as of the redemption date plus the Transaction Costs is referred to collectively as the "2006 PRINCIPAL AMOUNT", and the principal amount of the New Senior Notes in excess of the 2006 Principal Amount is referred to as the "EXCESS PRINCIPAL AMOUNT". (4) Reference is made to the Third Amendment to the Amended and Restated Security Agreement dated as of the date hereof (the "THIRD AMENDMENT TO THE SECURITY AGREEMENT") and the First Amendment to the Amended and Restated Collateral Agent Agreement dated as of the date hereof (the "FIRST AMENDMENT TO THE COLLATERAL AGENT AGREEMENT" and, together with the Third Amendment to the Amended and Restated Security Agreement, the "COLLATERAL AMENDMENTS"), pursuant to which the New Trustee and the holders of the New Senior Notes shall become beneficiaries of the security interest granted by the Company to the Senior Note Trustees and the holders of the Senior Notes in the Secured Debt Collateral (as such terms are defined in the Collateral Agent Agreement). (5) Prior to giving effect to this Amendment, Section 5.02(b) of the Credit Agreement would permit the Company to incur the Debt represented by the New Senior Notes only to the extent that such Debt does not exceed the principal amount (the "REFINANCING AMOUNT") of the Debt being refinanced by the New Senior Notes. (6) The Company has requested that the Lenders agree to amend the Credit Agreement to permit the Company to incur that portion of the Debt represented by the New Senior Notes in excess of the Refinancing Amount (the "EXCESS DEBT"). (7) The Required Lenders are, on the terms and conditions stated below, willing to grant the request of the Company, and the Company and the Required Lenders have agreed to amend the Credit Agreement as hereinafter set forth. SECTION 1. AMENDMENTS TO CREDIT AGREEMENT. The Credit Agreement is, effective as of the date hereof and subject to the satisfaction of the conditions precedent set forth in Section 3, hereby amended as follows: (a) Section 1.01 of the Credit Agreement is amended by: (i) Replacing the defined term "Secured Obligations" in its entirety with the following: "'SECURED OBLIGATIONS' means Secured Debt, as defined in the Security Agreement." (ii) Adding the following new definition in the appropriate alphabetical order: "`SENIOR NOTES' has the meaning specified in the Collateral Agent Agreement. `2006 SENIOR NOTES' has the meaning specified in Section 5.02(b)(iii)(C)." (b) Section 5.02(b)(iii)(C) of the Credit Agreement is amended by: (i) adding the clause "except as set forth in the second proviso of this clause (C)" immediately prior to the phrase "without any increase in the principal amount thereof" in the second parenthetical of such clause; and (ii) adding at the end thereof the following proviso: "; PROVIDED, FURTHER, that in the case of any refinancing of the Debt issued under the Existing Indenture described in clause (a) of the definition thereof (the "2006 SENIOR NOTES"), 2 (a) the Debt incurred to refinance such Debt may have additional obligors, either direct or contingent, to those in respect of the 2006 Senior Notes so long as each such obligor is the Borrower or a Subsidiary Guarantor and (b) the principal amount of the Debt incurred to refinance the Debt under such Existing Indenture may be in an aggregate principal amount of not more than $50 million greater than the principal amount outstanding under such Existing Indenture immediately prior to such refinancing (together with accrued and unpaid interest then outstanding and the costs and expenses incurred in connection with such refinancing), which additional principal amount may immediately be used by the Borrower to finance the general corporate purposes of the Borrower and its Subsidiaries, notwithstanding the requirements of the following proviso; PROVIDED, STILL FURTHER, that any Net Cash Proceeds received by the Borrower in connection with any refinancing of Debt issued under any of the Existing Indentures shall be applied within one Business Day to prepay Revolving Credit Advances, in which event (x) any Net Cash Proceeds in excess of the aggregate amount of outstanding Revolving Credit Advances shall be deposited and held either in a Deposit Account or a Security Account (as each term is defined in the Security Agreement) and (y) the Administrative Agent shall establish a reserve against the Loan Value equal to the principal amount of the Senior Notes being refinanced PLUS the amount of unpaid interest on such Senior Notes as of the redemption date PLUS the premium, fees and expenses payable in connection with the redemption of such Senior Notes, which reserve the Administrative Agent will reduce on the Business Day following receipt of written certification by a Responsible Financial Officer of the Borrower that the Borrower will redeem Senior Notes with the proceeds of a Revolving Credit Advance within three Business Days of the date of such notice, together with a Notice of Borrowing for such Revolving Credit Advance." SECTION 2. AUTHORIZATION. The Required Lenders hereby authorize (a) the Collateral Agent to enter into the Third Amendment to the Security Agreement and (b) the Collateral Agent and the Administrative Agent to enter into the First Amendment to the Collateral Agent Agreement. SECTION 3. CONDITIONS OF EFFECTIVENESS. This Amendment shall become effective as of the date first above written when, and only when the Administrative Agent shall have received counterparts of (a) this Amendment executed by the Company and the Required Lenders or, as to any of the Lenders, advice satisfactory to the Administrative Agent that such Lender has executed this Amendment, (b) the consent attached hereto executed by each Grantor and (c) each Collateral Amendment executed by the parties thereto. The effectiveness of this Amendment is conditioned upon the accuracy of the factual matters described herein. This Amendment is subject to the provisions of Section 8.01 of the Credit Agreement. SECTION 4. REPRESENTATIONS AND WARRANTIES OF THE COMPANY.The Company represents and warrants that: (a) The representations and warranties contained in each Loan Document are correct in all material respects on and as of the date of this Amendment, as though made on and as of such date, other than any such representations or warranties that, by their terms, refer to a specific date, in which case, as of such specific date. (b) No Default has occurred and is continuing on the date hereof and, after giving effect to the incurrence of the Excess Principal Amount, the Borrower will be in pro forma 3 compliance with the provisions of Section 5.04 of the Credit Agreement on the basis of the required financial information most recently delivered to the Administrative Agent and the Lender Parties as though the Excess Principal Amount had been incurred as of the first day of the fiscal period covered thereby. SECTION 5. REFERENCE TO AND EFFECT ON THE LOAN DOCUMENTS. (a) On and after the effectiveness of this Amendment, each reference in the Credit Agreement to "this Agreement", "hereunder", "hereof" or words of like import referring to the Credit Agreement, and each reference in the Notes and each of the other Loan Documents to "the Credit Agreement", "thereunder", "thereof" or words of like import referring to the Credit Agreement, shall mean and be a reference to the Credit Agreement, as amended by this Amendment. (b) The Credit Agreement, the Notes and each of the other Loan Documents, as specifically amended by this Amendment and the Collateral Amendments, are and shall continue to be in full force and effect and are hereby in all respects ratified and confirmed. Without limiting the generality of the foregoing, the Collateral Documents and all of the Collateral described therein do and shall continue to secure the payment of all Obligations of the Loan Parties under the Loan Documents, in each case as amended by this Amendment and the Collateral Amendments. (c) The execution, delivery and effectiveness of this Amendment shall not, except as expressly provided herein, operate as a waiver of any right, power or remedy of any Lender or the Administrative Agent under any of the Loan Documents, nor constitute a waiver of any provision of any of the Loan Documents. SECTION 6. COSTS AND EXPENSES.The Company agrees to pay on demand all reasonable out-of-pocket costs and expenses of the Administrative Agent in connection with the preparation, execution, delivery and administration, modification and amendment of this Amendment, the Collateral Amendments and the other instruments and documents to be delivered hereunder (including, without limitation, the reasonable fees and expenses of counsel for the Administrative Agent) in accordance with the terms of Section 8.04 of the Credit Agreement. SECTION 7. EXECUTION IN COUNTERPARTS. This Amendment may be executed in any number of counterparts and by different parties hereto in separate counterparts, each of which when so executed shall be deemed to be an original and all of which taken together shall constitute but one and the same agreement. Delivery of an executed counterpart of a signature page to this Amendment by telecopier shall be effective as delivery of a manually executed counterpart of this Amendment. SECTION 8. GOVERNING LAW. This Amendment shall be governed by, and construed in accordance with, the laws of the State of New York. 4 IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be executed by their respective officers thereunto duly authorized, as of the date first above written. BUILDING MATERIALS CORPORATION OF AMERICA By /s/ John M. Maitner ------------------------------------------ Name: John M. Maitner Title: Vice President and Treasurer 5 CITICORP USA, INC., as Administrative Agent and Lender By /s/ Michael M. Schadt ------------------------------------------ Name: Michael M. Schadt Title: Vice President Asset Based Finance (212) 816-2432 6 DEUTSCHE BANK TRUST COMPANY AMERICAS By /s/ Albert Fischetti ------------------------------------------ Name: Albert Fischetti Title: Director 7 CONGRESS FINANCIAL CORPORATION By /s/ David Hill ------------------------------------------ Name: David Hill Title: AVP 8 THE CIT GROUP/BUSINESS CREDIT, INC. By /s/ Howard Trebach ------------------------------------------ Name: Howard Trebach Title: Vice President 9 JPMORGAN CHASE BANK By /s/ John M. Harinzyi ------------------------------------------ Name: John M. Harinzyi Title: Vice President 10 GMAC COMMERCIAL FINANCE LLC By /s/ Daniel J. Murray ------------------------------------------ Name: Daniel J. Murray Title: First Vice President 11 FLEET CAPITAL CORPORATION By /s/ Ira A. Mermelstein ------------------------------------------ Name: Ira A. Mermelstein Title: Vice President 12 NATIONAL CITY BUSINESS CREDIT, INC. (formerly National City Commercial Finance, Inc.) By /s/ Jason Hanes ------------------------------------------ Name: Jason Hanes Title: Senior Associate 13 WELLS FARGO FOOTHILL, INC. By /s/ Juan Barrera ------------------------------------------ Name: Juan Barrera Title: Vice President 14 GENERAL ELECTRIC CAPITAL CORPORATION By /s/ James Desantis ------------------------------------------ Name: James Desantis Title: Duly Authorized Signatory 15 CONSENT Dated as of July 12, 2004 Each of the undersigned, as Guarantors under the Subsidiary Guaranty dated as of July 9, 2003 (the "GUARANTY") in favor of the Secured Parties (as defined in the Credit Agreement referred to in the foregoing Amendment), hereby consents to such Amendment and hereby confirms and agrees that (a) notwithstanding the effectiveness of such Amendment, the Guaranty is, and shall continue to be, in full force and effect and is hereby ratified and confirmed in all respects, except that, on and after the effectiveness of such Amendment, each reference in the Guaranty to the "Credit Agreement", "thereunder", "thereof" or words of like import shall mean and be a reference to the Credit Agreement, as amended by such Amendment, and (b) the Collateral Documents to which such Guarantor is a party and all of the Collateral described therein do, and shall continue to, secure the payment of all of the Secured Obligations (in each case, as defined therein). BMCA INSULATION PRODUCTS INC. BUILDING MATERIALS INVESTMENT CORPORATION BUILDING MATERIALS MANUFACTURING CORPORATION DUCTWORK MANUFACTURING CORPORATION GAF LEATHERBACK CORP. GAF MATERIALS CORPORATION (CANADA) GAF PREMIUM PRODUCTS INC. GAF REAL PROPERTIES, INC. GAFTECH CORPORATION LL BUILDING PRODUCTS INC. PEQUANNOCK VALLEY CLAIM SERVICE COMPANY, INC. SOUTH PONCA REALTY CORP. WIND GAP REAL PROPERTY ACQUISITION CORP. BMCA QUAKERTOWN INC. By /s/ John M. Maitner ------------------------------------------ Name: John M. Maitner Title: Vice President and Treasurer