EXHIBIT 10.5.2 THIRD AMENDMENT TO AMENDED AND RESTATED --------------------------------------- SERVICING SECURED CREDIT AGREEMENT ---------------------------------- THIS THIRD AMENDMENT TO AMENDED AND RESTATED SERVICING SECURED CREDIT AGREEMENT (the "Amendment") is made and dated as of the 16/th/ day of January, 1998, by and among THE FIRST NATIONAL BANK OF CHICAGO, a national banking association ("FNBC"), BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, a national banking association, THE BANK OF NEW YORK, a banking corporation organized under the laws of the State of New York (all of the above individually a "Lender" and, collectively, the "Lenders"), FNBC, as administrative agent for the Lenders (in such capacity, the "Administrative Agent"), and HEADLANDS MORTGAGE COMPANY, a California corporation (the "Company"). RECITALS -------- A. Pursuant to that certain Amended and Restated Servicing Secured Credit Agreement dated as of August 29, 1997 among the Administrative Agent, the Lenders and the Company (as amended to date, the "Agreement"), the Lenders agreed to extend credit to the Company on the terms and subject to the conditions set forth therein. All capitalized terms not otherwise defined herein shall have the meanings given to such terms in the Agreement. B. The Company has requested certain temporary waivers and temporary amendments to the Agreement and the Lenders have agreed thereto on certain conditions, all as more particularly described below. NOW, THEREFORE, in consideration of the foregoing Recitals and for other good and valuable consideration, the receipt and adequacy of which are hereby acknowledged, the parties hereto hereby agree as follows: AGREEMENT --------- 1. Temporary Waivers. The Company has requested a waiver of ----------------- compliance with certain financial covenants during the period from and including the Effective Date (as defined in Paragraph 5 below) to but excluding February 13, 1998 (the "Waiver Termination Date"). The Lenders hereby waive, on a temporary basis, compliance by the Company with the financial covenants set forth in Paragraphs 8(j) (Total Liabilities to Effective Net Worth; Total Liabilities to Adjusted Tangible Net Worth), 8(l)(2) (maximum repurchase obligations), and 8(m) (Current Ratio) during the period from and including the Effective Date to but excluding the Waiver Termination Date. On the Waiver Termination Date, the Company shall be required to be back in compliance with all such financial covenants. 2. Temporary Amendment. The Company has requested a temporary ------------------- modification of its covenant for maximum Total Liabilities during the period from and including the Effective 1 Date to but excluding the Waiver Termination Date. The parties hereto hereby agree that, during the period from and including the Effective Date to but excluding the Waiver Termination Date, Paragraph 8(n) of the Agreement shall be amended to replace the percentage "ninety-eight percent (98%)" in clause (2) thereof with the percentage "ninety-nine percent (99%)" and to replace the percentage "ninety-five percent (95%)" in clause (3) thereof with the percentage "ninety-eight percent (98%)". On the Waiver Termination Date, such amendments shall no longer be in effect and Paragraph 8(n) shall read as it did immediately prior to such amendments. 3. Reaffirmation of Other Loan Documents. The Company hereby affirms ------------------------------------- and agrees that (a) the execution and delivery by the Company of and the performance of its obligations under this Amendment shall not in any way amend, impair, invalidate or otherwise affect any of the obligations of the Company or the rights of the Secured Parties under the Security Agreement or any other Loan Document, (b) the term "Obligations" as defined in Paragraph 12 of the Agreement includes, without limitation, the Obligations of the Company under the Agreement as amended by this Amendment, (c) the Security Agreement remains in full force and effect and such agreement constitutes a continuing first priority security interest in and lien upon the Collateral, and (d) for any and all purposes, any reference to the Agreement following the effective date of this Amendment shall constitute a reference to the Agreement as amended to date, including, without limitation, by this Amendment. 4. Modification of Related Documents. All reports and other forms --------------------------------- utilized in connection with the day-to-day operations of the credit facility evidenced by the Agreement shall be deemed modified consistent with the provisions of this Amendment. 5. Effective Date. This Amendment shall be effective on the -------------- earliest date (the "Effective Date") upon which the Administrative Agent has received duly executed copies of this Amendment from each of the Lenders, the Administrative Agent and the Company. 6. Representations and Warranties. The Company hereby represents and ------------------------------ warrants to the Administrative Agent and the Lenders as follows: (a) The Company has the corporate power and authority and the legal right to execute, deliver and perform this Amendment and has taken all necessary corporate action to authorize the execution, delivery and performance of this Amendment. This Amendment has been duly executed and delivered on behalf of the Company and constitutes the legal, valid and binding obligation of the Company enforceable against the Company in accordance with its terms. The execution, delivery and performance of this Amendment will not violate any Requirement of Law or Contractual Obligation or require any consent, approval or authorization of, or registration, declaration or filing with, any Governmental Authority. (b) At and as of the date of execution hereof and at and as of the effective date of this Amendment and both prior to and after giving effect hereto: (1) the representations and warranties of the Company contained in the Loan Documents are accurate and complete in all respects, and (2) there has not occurred an Event of Default or Potential Default. 2 7. No Other Amendment. Except as expressly amended herein, the Loan ------------------ Documents shall remain in full force and effect as currently written. 8. Counterparts. This Amendment may be executed in any number of ------------ counterparts, each of which when so executed shall be deemed to be an original and all of which when taken together shall constitute one and the same agreement. 3 IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be executed as of the day and year first above written. HEADLANDS MORTGAGE COMPANY, a California corporation By: ------------------------------- Name: ------------------------------ Title: ----------------------------- THE FIRST NATIONAL BANK OF CHICAGO, a national banking association, as Administrative Agent and a Lender By: ------------------------------- Name: ------------------------------ Title: ----------------------------- BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, a national banking association, as a Lender By: ------------------------------- Name: ------------------------------ Title: ----------------------------- THE BANK OF NEW YORK, a banking corporation organized under the laws of the State of New York, as a Lender By: ------------------------------- Name: ------------------------------ Title: ----------------------------- 4