Exhibit 4.0.4 SECOND AMENDMENT TO REVOLVING CREDIT AND SECURITY AGREEMENT BY AND AMONG PNC BANK, NATIONAL ASSOCIATION (AS LENDER AND AGENT), THE LENDERS, AND L. B. FOSTER COMPANY, CXT INCORPORATED, NATMAYA, INC., AND FOSMART, INC. (BORROWERS) January 28, 2005 SECOND AMENDMENT TO REVOLVING CREDIT AND SECURITY AGREEMENT THIS SECOND AMENDMENT TO REVOLVING CREDIT AND SECURITY AGREEMENT (the "Amendment") is made as of January 28, 2005, by and among L. B. FOSTER COMPANY, a corporation organized under the laws of the State of Pennsylvania ("Foster"), CXT INCORPORATED, a corporation organized under the laws of the State of Delaware ("CXT"), NATMAYA, INC., a corporation organized under the laws of the State of Delaware ("Natmaya"), and FOSMART, INC., a corporation organized under the laws of the State of Delaware ("Fosmart") (each a "Borrower" and collectively "Borrowers"), the financial institutions which are now or which hereafter become a party hereto (collectively, the "Lenders" and individually a "Lender") and PNC BANK, NATIONAL ASSOCIATION ("PNC"), as agent for Lenders (PNC, in such capacity, the "Agent"). W I T N E S S E T H: WHEREAS, the Borrowers, the Lenders and Agent are parties to that certain Revolving Credit and Security Agreement dated as of September 26, 2002, as amended by a First Amendment thereto dated as of September 8, 2003, (as amended from time to time, the "Agreement"). WHEREAS, the Borrowers have requested the Lenders to amend the agreement in connection with certain transactions relating to Marquo Inc., a supplier and contractor to the Geotech Division of Foster. WHEREAS, the parties hereto desire to amend the terms of the Agreement as provided for herein. NOW, THEREFORE, the parties hereto, in consideration of their mutual covenants and agreements hereinafter set forth and intending to be legally bound hereby, covenant and agree as follows: 1. Definitions. ------------ Defined terms used herein shall have the meanings given to them in the Agreement. 2. The following new definition is hereby inserted in Section 1.2 of the Agreement in alphabetical order: "Marquo" shall mean Marquo Inc., a corporation incorporated under the laws of the state of Colorado. 3. Section 2.9 of the Agreement is hereby amended and restated as follows: "2.9 Letters of Credit and Acceptances. ---------------------------------- Subject to the terms and conditions hereof, Agent shall (a) issue or cause the issuance of standby and documentary (trade) Letters of Credit ("Letters of Credit") on behalf of any Borrower, or (b) accept, or cause to be accepted Acceptances; provided, however, that Agent will not be required to issue or cause to be issued any Letters of Credit or accept or cause to be accepted any Acceptances to the extent that the face amount of such Letters of Credit and Acceptances would then cause the sum of (i) the outstanding Revolving Advances plus (ii) outstanding Letters of Credit plus (iii) outstanding Acceptances to exceed the lesser of (x) the Maximum Revolving Advance Amount or (y) the Formula Amount. The maximum amount of outstanding Letters of Credit and Acceptances shall not exceed $15,000,000 in the aggregate at any time. All disbursements or payments related to Letters of Credit and Acceptances shall be deemed to be Domestic Rate Loans consisting of Revolving Advances and shall bear interest at the Revolving Interest Rate for Domestic Rate Loans; Letters of Credit that have not been drawn upon shall not bear interest. That certain Irrevocable Letter of Credit No. S247285NJY dated April 10, 2002, in the amount of $409,863.01 issued for the benefit of J. P. Morgan Trust Company, National Association, as Trustee, shall from and after the Closing Date be deemed to be issued pursuant to this Agreement, including without limitation, Sections 2.9, 2.10, 2.11 and 3.2, and this Agreement shall amend and restate the provisions of that certain Reimbursement, Credit and Security Agreement dated as of April 1, 2002, between Foster and PNC with respect to such Letter of Credit." 4. Section 7.5 of the Agreement is hereby amended and restated as follows: "7.5 Loans. Make advances, loans or extensions of credit to any Person, including without limitation, any Parent, Subsidiary or Affiliate except with respect to (a) the extension of commercial trade credit in connection with the sale of Inventory in the ordinary course of its business and (b) loans advanced to its employees in the ordinary course of business not to exceed the aggregate amount of $1,000,000 at any time outstanding, (c) loans advanced by one Borrower to another Borrower, (d) advances made by a Borrower to RP&F, provided however, (i) advances to RP&F shall be limited to the amounts permitted in Section 7.1(b) plus an additional amount not in excess of $250,000 in the aggregate at any one time outstanding and (ii) advances to RP&F shall be made on or before December 31, 2003, and (e) loans made by Foster to Marquo; provided however, such loans to Marquo shall not exceed $1,500,000 in the aggregate at any one time outstanding." 5. Amendment Fee. The Borrowers shall pay to the Agent, for the ratable benefit of the Lenders, an amendment fee in the amount of $12,000, which fee shall be deemed to be earned as of the date hereof. 6. Representations. The Borrowers each represent and warrant that it has the corporate power and has been duly authorized by all requisite corporate action to execute and deliver this Amendment and to perform its obligations hereunder. The Borrowers each represent and warrant that no Default or Event of Default exists under the Credit Agreement or shall result from the execution and delivery of this Amendment. 7. Force and Effect. Each Lender and each Borrower reconfirms and ratifies the Agreement and all Other Documents executed in connection therewith except to the extent any such documents are expressly modified by this Amendment, and each Borrower confirms that all such documents have remained in full force and effect since the date of their execution. 8. Governing Law. This Amendment shall be deemed to be a contract under the laws of the Commonwealth of Pennsylvania and for all purposes shall be governed by and construed and enforced in accordance with the internal laws of the Commonwealth of Pennsylvania without regard to its conflict of laws principles. 9. Counterparts; Effective Date. This Amendment may be signed by telecopy or original in any number of counterparts, each of which shall be deemed an original, but all of which together shall constitute one and the same instrument. This Amendment shall become effective as of the date first above written upon its execution and delivery by the Borrowers and the Required Lenders and payment of the amendment fee required under Section 6 hereof. [SIGNATURE PAGES FOLLOW] [SIGNATURE PAGE 1 OF 2 TO SECOND AMENDMENT TO REVOLVING CREDIT AND SECURITY AGREEMENT] Intending to be legally bound, each of the parties has signed this Second Amendment to Revolving Credit and Security Agreement as of the day and year first above written. ATTEST: L. B. FOSTER COMPANY By:/s/ David J. Russo [Seal] - --------------------- ------------------------------------------------- Name: David J. Russo --------------------------------------------- Title: Senior Vice President and CFO -------------------------------------------- ATTEST: CXT INCORPORATED By:/s/ David J. Russo [Seal] - --------------------- ------------------------------------------------- Name: David J. Russo --------------------------------------------- Title: Senior Vice President and CFO -------------------------------------------- ATTEST: NATMAYA, INC. By:/s/ Judith J. Scarborough [Seal] - --------------------- ------------------------------------------------- Name: Judith J. Scarborough ----------------------------------------------- Title: President -------------------------------------------- ATTEST: FOSMART, INC. By: /s/ Judith J. Scarborough [Seal] - --------------------- ------------------------------------------------- Name: Judith J. Scarborough ----------------------------------------------- Title: President ---------------------------------------------- - 2 - [SIGNATURE PAGE 2 OF 2 TO SECOND AMENDMENT TO REVOLVING CREDIT AND SECURITY AGREEMENT] PNC BANK, NATIONAL ASSOCIATION, a national banking association, as Lender and as Agent By: /s/ James M. Steffy --------------------------------------------- Name: James M. Steffy ----------------------------------------- Title: Vice President ---------------------------------------- LASALLE BANK NATIONAL ASSOCIATION By: /s/ Robert W. Hart --------------------------------------------- Name: Robert W. Hart ------------------------------------------- Title: Senior Vice President ---------------------------------------- FIRST COMMONWEALTH BANK By: /s/Paul J. Oris --------------------------------------------- Name: Paul J. Oris ----------------------------------------- Title: V.P. ------------------------------------------