PAYOFF AGREEMENT PAYOFF AGREEMENT, dated May 25, 1995 (the "Payoff Agreement"), by and among Indian Refining Limited Partnership, an Illinois limited partnership ("IRLP"), Indian Refining & Marketing Inc., an Illinois corporation ("IRMI"), Castle Energy Corporation, a Delaware corporation ("Castle"), Indian Powerine L.P., an Illinois limited partnership ("IPLP"), Metallgesellschaft Corp., a Delaware corporation ("MG Corp."), MG Refining and Marketing, Inc., a Delaware corporation ("MGRM"), and MG Trade Finance Corp., a Delaware corporation ("MGTF"). IRLP, IRMI, Castle and IPLP are collectively referred to herein as the "Castle Parties," and MG Corp., MGRM and MGTF are collectively referred to herein as the "MG Parties." The parties hereto desire to resolve their respective obligations under and in connection with (i) the Amended and Restated Revolving Loan and Security Agreement, dated as of May 27, 1993, among IRLP, IRMI, and MGTF (the "Loan Agreement"), (ii) the Amended and Restated Offtake Agreement, dated as of October 1, 1993 (as amended, the "Offtake Agreement") between MGRM and IRLP, (iii) the Amended and Restated Guaranty dated as of October 14, 1994 (as amended, the "Guaranty") executed by Castle for the benefit of MGTF, (iv) the Support Agreement dated as of May 27, 1993 executed by MG Corp. in favor of IRLP (the "MG Corp. Support Agreement"), and (v) the Support Agreement dated as of May 27, 1993 executed by Metallgesellschaft AG ("MGAG") in favor of IRLP (the "MGAG Support Agreement") (the Loan Agreement, the Offtake Agreement, the Guaranty, the MG Corp. Support Agreement and the MGAG Support Agreement together with all promissory notes and guarantees related thereto and all exhibits and schedules attached thereto and all security granted in connection therewith, are collectively referred to as the "Documents"). ACCORDINGLY, in consideration of the covenants and subject to the conditions contained herein, the parties hereto hereby agree as follows, it being the intent of the parties that all of the actions, payments, and deliveries provided for herein shall occur simultaneously upon the execution and delivery hereof except as expressly otherwise provided: 1. Payoff and Termination of Loan Agreement and other Documents. On the date hereof, IRLP shall pay (on or before 4:00 p.m. New York City time) to MGTF the sum of $18,166,765.65 in immediately available funds by wire transfer in full satisfaction of the Obligations (as defined in the Loan Agreement), and upon such payment, the Loan Agreement and the other Documents, to the extent not already terminated, shall terminate as of the date hereof and all rights and obligations of all of the parties thereto under the Loan Agreement and the other Documents, to the extent not already terminated, shall be terminated. 2. Release of Liens. On the date hereof, all liens and security interests in and to all of IRLP's and IPLP's assets granted to any MG Party in connection with the Documents, some of which have been assigned to Union Bank of Switzerland, as collateral agent ("UBS"), will be deemed fully and finally released. As of the date hereof, the MG Parties hereby agree, and hereby agree to cause UBS, as secured party of record, to execute and deliver to IRLP or IPLP, as applicable, the appropriate UCC-3 termination statements, mortgage releases, and any other instruments or documents prepared by IRLP or IPLP that IRLP or IPLP reasonably requests, and take and cause to be taken such further actions as may be necessary or proper in the reasonable opinion of IRLP (the form of such instruments, documents and/or actions to be subject to the review and approval of the applicable MG Party, such approval not to be unreasonably withheld or delayed. 3. Return of Collateral. On the date hereof, the appropriate MG Parties shall, and shall cause UBS to, forthwith deliver to IRLP and IPLP Collateral under the Documents and other evidences of release, including without limitation, as set forth on Schedule I attached hereto. 4. Further Assurances. (a) Each of the Castle Parties shall, upon the reasonable request of the MG Parties and MGAG, duly execute and deliver, or cause to be duly executed and delivered, such further instruments prepared by an MG Party and take and cause to be taken such further actions as may be necessary or proper in the reasonable opinion of the MG Parties and MGAG (the form of such instruments and/or actions to be subject to the review and approval of the applicable Castle Party, such approval not to be unreasonably withheld) to carry out more effectually the provisions and purposes of this Payoff Agreement. (b) Each of the MG Parties and MGAG shall, upon the reasonable request of the Castle Parties, duly execute and deliver, or cause to be duly executed and delivered, such further instruments prepared by a Castle Party and take and cause to be taken such further actions as may be necessary or proper in the reasonable opinion of the Castle Parties (the form of such instruments and/or actions to be subject to the review and approval of the applicable MG Party, such approval not to be unreasonably withheld) to carry out more effectually the provisions and purposes of this Payoff Agreement. Without limiting the generality of the foregoing, not more than five business days after the date hereof, MGTF and the applicable Castle Party shall execute and file stipulations discontinuing and dismissing with prejudice the cases captioned MG Trade Finance Corp. v. Indian Refining Limited Partnership, no. 108181/95 (Supreme Court of the State of New York, New York County) and MG Trade Finance Corp. v. Castle Energy Corporation, no. 95 C 04001 (Superior Court of the State of Delaware, New Castle County). 5. Notices. All notices and other communications to any party hereunder shall be in writing and shall be personally delivered or sent by certified mail, -2- postage prepaid, return receipt requested, or by a reputable courier delivery service or by prepaid telex or telecopy and shall be given to the address or telex or telecopier number for such party set forth below such party's signature to this Payoff Agreement, or to such other address or telex or telecopier number as such party may hereafter specify by notice to the other party. Each such notice or other communication shall be effective (a) if given by telex or telecopier, when such telex or telecopy is transmitted to the telex or telecopier number specified by this Section and the appropriate answerback or confirmation is received, (b) if given by certified mail, 72 hours after such communication is deposited with the post office, addressed as aforesaid or (c) if given by any other means (including, without limitation, by courier), when delivered at the address specified by this Section. 6. Amendments and Waivers. No amendment or waiver of any provision of this Payoff Agreement shall in any event be effective unless the same shall be in writing and signed by all parties hereto. 7. Binding Effect. This Payoff Agreement shall be binding upon and inure to the benefit of the Castle Parties and the MG Parties and their respective successors and permitted assigns; none of the parties hereto shall have the right to assign any of their respective rights or obligations except as expressly provided or permitted herein. 8. Execution in Counterparts. This Payoff Agreement may be executed in any number of counterparts and by the different parties hereto on separate counterparts, each of which when so executed and delivered shall be deemed an original and all of which shall together constitute one and the same agreement. 9. Integration. This Payoff Agreement and the documents delivered hereunder and herewith contain a final and complete integration of all prior expressions by the parties hereto with respect to the subject matter hereof and shall constitute the entire agreement among the parties hereto with respect to the subject matter hereof, superseding all prior oral and written understandings. 10. Captions. The captions of the sections of this Payoff Agreement have been inserted for convenience only and shall not in any way affect the meaning or construction of any provision of this Payoff Agreement. -3- IN WITNESS WHEREOF, each of the parties hereto has caused this Payoff Agreement to be duly executed by its respective officers duly authorized as of the day and year first above written. INDIAN REFINING LIMITED PARTNERSHIP BY INDIAN REFINING & MARKETING INC., ITS GENERAL PARTNER By: /s/ William S. Sudhaus -------------------------------------------- Title: Chief Executive Officer --------------------------------------- South Seventh Street Lawrenceville, IL 62439 Attention: William S. Sudhaus Telefax: (618) 943-4180 INDIAN REFINING & MARKETING INC. By: /s/ William S. Sudhaus -------------------------------------------- Title: Chief Executive Officer --------------------------------------- South Seventh Street Lawrenceville, IL 62439 Attention: William S. Sudhaus Telefax: (618) 943-4180 CASTLE ENERGY CORPORATION By: /s/ Joseph L. Castle, II -------------------------------------------- Title: Chief Executive Officer --------------------------------------- One Matsonford Road Radnor, PA 19087 Telefax: (610) 995-0409 -4- INDIAN POWERINE LIMITED PARTNERSHIP BY IP OIL CO., ITS GENERAL PARTNER By: /s/ William S. Sudhaus -------------------------------------------- Title: Chief Executive Officer --------------------------------------- 1331 Lamar, Suite 1331 Houston, TX 77010 Telefax: (713) 650-8303 METALLGESELLSCHAFT CORP. By: /s/ Marcelo Parra --------------------------------------------- Title: Sr. Vice President and Treasurer ---------------------------------------- 520 Madison Avenue New York, New York 10022 Attention: Arthur G. Taylor, Esq. Telefax: (212) 826-9042 MG TRADE FINANCE CORP. By: /s/ Joseph P. Gallagher --------------------------------------------- Title: Vice President ---------------------------------------- 520 Madison Avenue New York, New York 10022 Attention: Arthur G. Taylor, Esq. Telefax: (212) 826-9042 MG REFINING AND MARKETING, INC. By: /s/ Marcelo Parra --------------------------------------------- Title: Vice President ---------------------------------------- 520 Madison Avenue New York, New York 10022 Attention: Arthur G. Taylor, Esq. Telefax: (212) 826-9042 -5-