EXHIBIT 10.4 CONFORMED COPY AMENDED AND RESTATED EXCHANGE AGREEMENT THIS AMENDED AND RESTATED EXCHANGE AGREEMENT (this "Agreement"), dated as of August 12, 1997, as amended and restated as of May 6, 2002, is entered into among BUCKEYE PIPE LINE COMPANY, a Delaware corporation (the "General Partner"), BUCKEYE MANAGEMENT COMPANY, a Delaware corporation and owner of all of the outstanding common stock of the General Partner ("BMC"), BUCKEYE PARTNERS, L.P., a Delaware limited partnership (the "Partnership"), and BUCKEYE PIPE LINE COMPANY L.P., a Delaware limited partnership, BUCKEYE PIPE LINE COMPANY OF MICHIGAN, L.P., a Delaware limited partnership LAUREL PIPE LINE COMPANY, L.P., a Delaware limited partnership, EVERGLADES PIPE LINE COMPANY, L.P., a Delaware limited partnership and BUCKEYE PIPE LINE HOLDINGS, L.P., a Delaware limited partnership (formerly Buckeye Tank Terminals Company, L.P.) (together, the "Operating Partnerships"), and GLENMOOR, LTD., a Delaware corporation (formerly BMC Acquisition Company) and owner of all of the outstanding common stock of BMC ("Glenmoor"). WITNESSETH: WHEREAS, BMC, the Partnership, the General Partner, the Operating Partnerships and Glenmoor entered into the Exchange Agreement, dated as of August 12, 1997 (the "Prior Agreement"), which was consummated on such date effective as of 11:59 P.M.; WHEREAS, the parties to the Prior Agreement desire to amend and restate the Prior Agreement in its entirety to reflect that (i) the General Partner has replaced BMC as the general partner of the Partnership, (ii) the parties desire that Section 3.01 of the Prior Agreement be revised to eliminate the "Forfeiture Payment," and (iii) the names of certain parties have been changed; WHEREAS, the General Partner is the general partner of the Partnership and the Operating Partnerships; WHEREAS, the Operating Partnerships are owned 99% by the Partnership, and 1% by the General Partner (except that Buckeye Pipe Line Company of Michigan, L.P., is owned 98.01% by Laurel Pipe Line Company, L.P., and 1.99% by the General Partner); WHEREAS, the Partnership is governed pursuant to an Amended and Restated Agreement of Limited Partnership (the "Master Partnership Agreement"), dated as of December 31, 1998, between the General Partner and the limited partners of the Partnership (the "Limited Partners"); the Operating Partnerships, other than Laurel Pipe Line Company, L.P., are governed pursuant to similar Amended and Restated Agreements of Limited Partnership, each dated as of December 23, 1986, as amended, between the General Partner and the Partnership; and Laurel Pipe Line Company, L.P. is governed pursuant to an Amended and Restated Agreement of Limited Partnership dated October 21, 1992, between the General Partner and the Partnership (collectively, the "Operating Partnership Agreements"); WHEREAS, in connection with the Prior Agreement, a special committee (the "Special Committee") of the disinterested directors of BMC (as the former general partner of the Partnership), determined it to be in the best interests of the Partnership (i) to issue limited partnership units of the Partnership ("LP Units") to Buckeye Pipe Line Services Company, a Pennsylvania corporation (the "Company") whose shares of capital stock were owned by the Glenmoor Employee Stock Ownership Plan (now known as the Buckeye Pipe Line Services Company Employee Stock Ownership Plan, and referred to herein as the "ESOP"), in exchange for 63,000 shares of Glenmoor Series A Convertible Preferred Stock, stated value $1,000 per share (the "Glenmoor Preferred Stock"), (ii) to have the Partnership convert the Glenmoor Preferred Stock into Glenmoor Common Stock ("Glenmoor Common Stock"), and (iii) to contribute the Glenmoor Common Stock to the Operating Partnerships (collectively, the "Restructuring"); WHEREAS, pursuant to the LP Unit Subscription Agreement, dated as of the date of the Prior Agreement (the "LP Unit Subscription Agreement"), the Partnership issued 1,286,573 LP Units to the Company in exchange for the Glenmoor Preferred Stock; WHEREAS, pursuant to a notice to Glenmoor as of the date of the Prior Agreement, the Partnership converted the Glenmoor Preferred Stock received pursuant to the LP Unit Subscription Agreement into 484,616 shares of Glenmoor Common Stock (the "Exchange Shares"); WHEREAS, the Partnership contributed an undivided interest in the Exchange Shares to the Operating Partnerships as of the date of the Prior Agreement; and WHEREAS, the Operating Partnerships transferred and assigned the Exchange Shares to the General Partner as of the date of the Prior Agreement in exchange for the release of certain obligations that the Partnership had to BMC (as the former general partner of the Partnership) and the General Partner, and the Operating Partnerships had to the General Partner; Glenmoor and BMC caused the General Partner to receive the Exchange Shares and to release such obligations of the Partnership and the Operating Partnerships; and the Exchange Shares were further transferred by the General Partner to BMC and by BMC to Glenmoor. NOW, THEREFORE, the parties hereto, intending to be legally bound hereby, agree as follows: ARTICLE I THE EXCHANGE Upon the terms and subject to the conditions of this Agreement, the Operating Partnerships have transferred and assigned the Exchange Shares to the General Partner in exchange for the release of certain obligations of the Partnership to BMC (as the former general partner of the Partnership) and the General Partner, and of the Operating Partnerships to the General Partner, as set forth in Article II below. ARTICLE II RELEASE OF OBLIGATIONS 2.01 Obligations to Reimburse for Executive Compensation. (a) Upon the terms and subject to the conditions of this Agreement, Glenmoor, BMC and the General Partner, for themselves and their affiliates, successors and assigns, hereby and irrevocably release, relinquish and discharge the Partnership and the Operating Partnerships from any and all liability, obligation, claim, demand, action or suit of any kind or nature, in law or in equity, whatsoever, known or unknown, which may be asserted for or on account of or arising out of or in any manner relating to the Partnership's and/or the Operating Partnerships' obligations pursuant to Section 7.4(b) of the Master Partnership Agreement and the Operating Partnership Agreements or otherwise to reimburse Glenmoor, BMC, or the General Partner for total compensation paid for executive level duties performed for BMC or the General Partner with respect to the functions of operations, finance, legal, marketing and business development, and treasury, as well as President of the General Partner following the date of the Prior Agreement. The parties hereto acknowledge that the individuals who performed those executive level functions as of the date of the Prior Agreement were: Michael P. Epperly, Steven C. Ramsey, Stephen C. Muther, William H. Shea, Jr., David J. Martinelli and C. Richard Wilson, respectively, and their total compensation in all forms on a pro forma annualized basis for 1996 was $2,300,000; the parties further acknowledge that Michael P. Epperly and C. Richard Wilson have resigned and their respective duties have been assumed by the remaining executives. Nothing in this Section 2.01(a) shall be deemed to waive the obligations of the Partnership and the Operating Partnerships to reimburse BMC and the General Partner for (i) employee fringe benefits and retirement benefits for their executives relating to services performed prior to the date of the Prior Agreement, (ii) obligations under severance agreements with their executives to the extent currently reimbursable under the Master Partnership Agreement or (iii) any obligations in respect of their executives which are not related to compensation, including, without limitation, indemnification obligations. (b) Glenmoor, BMC and the General Partner agree, unless the General Partner is removed as general partner of the Partnership, to perform the executive level functions referred to in Section 2.01(a) for the benefit of the Partnership and the Operating Partnerships in a manner satisfactory to the board of directors of the General Partner. 2.02 ESOP Contributions Generally. (a) From the date of the Prior Agreement until all principal, interest and premium is paid in full under the Amended and Restated Note Agreement, dated as of the date of the Prior Agreement, among the ESOP, The Prudential Insurance Company of America and Pruco Life Insurance Company (the "Note Agreement") (the "ESOP Period"), and only following the exhaustion of the "Top Up Reserve Fund" provided for in paragraph (b) below, the Partnership and the Operating Partnerships shall reimburse the General Partner and BMC for (i) cash contributions made by the Company to the ESOP pursuant to the terms thereof, as necessary for the ESOP to make all payments of principal, interest (including additional interest payable as the result of an interest rate increase under paragraph 7 of the Note Agreement) and premium due under the Note Agreement (excluding, however, the accelerated portion of any payments which have become due and payable upon acceleration of such indebtedness as the result of a default under the Note Agreement), (ii) any income taxes incurred by the Company on the sale of LP Units made to satisfy the redemption obligations described in Section 2.03 below, and (iii) routine administrative charges and expenses common to employee stock ownership plans incurred in connection with the operation of the ESOP, in each case, to the extent distributions from LP Units owned by the Company are not sufficient to make all such payments. Following the ESOP Period, the Partnership and the Operating Partnerships shall have no further obligations to reimburse BMC or the General Partner for contributions to the ESOP. (b) Top Up Reserve Fund. For purposes of this Agreement, the "Top Up Reserve Fund" shall mean the amount set forth on a statement delivered by BMC (as the former general partner of the Partnership) to the Partnership on the date of the Prior Agreement which is equal to the amount of all reimbursements associated with the ESOP made to BMC (as the former general partner of the Partnership) by the Partnership prior to the date of the Prior Agreement, minus the actual cash payments by the ESOP for principal and interest payments and routine administrative charges and expenses actually incurred by the ESOP as of the date of the Prior Agreement. 2.03 No ESOP Contributions for Departing Employees. BMC and the General Partner acknowledge that neither the Partnership nor the Operating Partnerships shall be obligated to reimburse Glenmoor, BMC or the General Partner for obligations to redeem the ESOP accounts of departing employees upon the termination of their employment with the Company, or for any other costs or expenses of or relating to the operation of the ESOP other than those specified in Section 2.02(a) above. 2.04 Representations and Warranties. Glenmoor, BMC and the General Partner hereby represent and warrant to the Partnership and the Operating Partnerships, as of the date of the Prior Agreement, that (a) neither the Company nor any entity treated as a single employer with the Company under Sections 414(b), 414(c), 414(m), or 414(o) of the Internal Revenue Code of 1986, as amended (the "Code"), or Section 4001(b) of the Employee Retirement Income Security Act of 1974, as amended ("ERISA"), has incurred any liability under any provision of ERISA or other applicable law relating to the ESOP; (b) the ESOP has been administered, in all material respects, in compliance with its terms and complies, both in form and operation, with the applicable provisions of ERISA (including, without limitation, the funding and prohibited transactions provisions thereof), the Code and other applicable laws; (c) the ESOP has been determined by the Internal Revenue Service to be qualified within the meaning of Section 401 of the Code, and none of Glenmoor or BMC or the General Partner is aware of any fact or circumstances which would adversely affect the qualified status of the ESOP; and (d) the restructuring of the ESOP contemplated by this Agreement does not constitute a "prohibited transaction" under ERISA. 2.05 Certain Agreements. (a) The parties acknowledge that nothing in the Services Agreement, dated as of the date of the Prior Agreement (the "Services Agreement"), among BMC, the General Partner and the Company shall be deemed to enlarge the obligation of the Partnership to reimburse BMC or the General Partner under the Master Partnership Agreement or the obligation of the Operating Partnerships to reimburse the General Partner under the Operating Partnership Agreements. Furthermore, the Partnership and the Operating Partnerships shall have no obligation to reimburse BMC or the General Partner for the amounts paid to the Company pursuant to Article V of the Services Agreement unless such amounts were paid as reimbursement for costs and expenses for which BMC or the General Partner would be entitled to reimbursement under the Master Partnership Agreement or the Operating Partnership Agreements, as such agreements have been modified by the terms hereof, if BMC or the General Partner had incurred such costs and expenses directly. In addition, the Partnership and the Operating Partnerships shall have no obligation to reimburse BMC or the General Partner for amounts paid to the Company pursuant to Article VI of the Services Agreement unless such amounts were paid as indemnification for damages and expenses for which BMC or the General Partner would be entitled to indemnification under the Master Partnership Agreement or the Operating Partnership Agreements if BMC or the General Partner had incurred such damages or expenses directly. (b) The Partnership and each of the Operating Partnerships waive, as of the date of the Prior Agreement, any right of offset or counterclaim or similar right it may have against BMC or the General Partner with respect to their respective obligations to reimburse BMC or the General Partner, as the case may be, for contributions to the ESOP pursuant to Section 2.02 hereof. (c) The parties acknowledge that the Partnership and the Operating Partnerships are not obligated to reimburse BMC or the General Partner if any tax is owed by Glenmoor, BMC or the General Partner pursuant to Section 83 of the Internal Revenue Code as a result of the Restructuring. ARTICLE III FORFEITURE 3.01 Failure to Act as General Partner Over the ESOP Period. Except to the extent this obligation is assumed by a successor general partner pursuant to Section 3.02, the General Partner shall continue to serve as the general partner of the Partnership and the Operating Partnerships until the end of the ESOP Period unless the Partnership shall be sooner dissolved under Section 14.1(d) of the Master Partnership Agreement. 3.02 Assumption of Obligations by a Successor General Partner. If the General Partner is removed as general partner of the Partnership or one or more of the Operating Partnerships during the ESOP Period (but not if the General Partner voluntarily withdraws as general partner) pursuant to Section 13.1(b) of the Master Partnership Agreement, the General Partner may cause the successor general partner of the Partnership and the Operating Partnerships to assume its respective obligations, liabilities and duties under this Agreement. 3.03 ESOP Loan Secured. The Partnership and the Operating Partnerships acknowledge that Glenmoor, BMC and the General Partner have each executed and delivered a Guaranty Agreement pursuant to which each has guaranteed the payment and performance of all obligations under the Note Agreement and related documents (the "Note Obligations"), and that such guaranty obligations are secured by substantially all assets of Glenmoor, BMC and the General Partner, respectively. ARTICLE IV TAX INDEMNITY AGREEMENT 4.01 Indemnification by the General Partner. Glenmoor, BMC and the General Partner shall, jointly and severally, reimburse and indemnify and hold the Partnership and each Operating Partnership harmless against and in respect of any and all damage, loss, liability, deficiency, settlement payments, interest (including any increase in the rate of interest paid on any loan to the ESOP), penalties, obligations, levies or expenses (including without limitation reasonable legal fees and expenses) (collectively, "Damages") in connection with, resulting from or relating to one of (i) the failure of the lenders to the ESOP to qualify pursuant to Section 133 of the Internal Revenue Code for the interest received exclusion in connection with the loan to the ESOP as a result of the Restructuring or (ii) any excise tax imposed as a result of the Restructuring (each, a "Tax Risk"). The Partnership and the Operating Partnerships shall pay to the ESOP or the lenders to the ESOP (in the case of the Tax Risk described above in clause (i) of this Section 4.01), or to the appropriate taxing authority or other third party (in the case of the Tax Risk described above in clause (ii) of this Section 4.01) any Damages in the event that a Tax Risk is incurred, subject to the foregoing reimbursement obligation. None of Glenmoor, BMC, the General Partner or their respective affiliates shall be entitled to reimbursement from the Partnership or any Operating Partnership for any indemnification payment made pursuant to this Article IV. 4.02 Selection of Tax Risk. The disinterested directors of the board of directors of the General Partner shall determine the Tax Risk for which the Partnership and the Operating Partnerships shall be entitled to indemnification from Glenmoor, BMC and the General Partner and such directors may make such determination at any time. Such determination shall be communicated to the entire board of directors in writing and once so communicated may not be modified or revoked. 4.03 Loan From Partnership. Subject to Section 7.7(g) of the Master Partnership Agreement, in the event that a Tax Risk is incurred, and the Partnership or the Operating Partnerships incur the Damages associated therewith, the General Partner shall issue to the Partnership a promissory note (the "Note") for the amount of the Damages, with interest calculated at the rate (including points or other financing charges or fees) that the General Partner would be charged by an unrelated lender on a comparable loan. The Note shall be payable by right of offset of the amounts due to the General Partner under the Amended and Restated Incentive Compensation Agreement dated as of March 22, 1996, as amended from time to time, until the Note is paid in full. ARTICLE V GENERAL PROVISIONS 5.01 Entire Agreement. This Agreement supersedes all prior discussions and agreements among the parties hereto with respect to the subject matter hereof and contains the sole and entire agreement among the parties hereto with respect to the subject matter hereof. 5.02 Headings. The headings used in this Agreement have been inserted for convenience of reference only and do not define or limit the provisions hereof. 5.03 Waiver and Amendment. No failure by any party to insist upon the strict performance of any covenant, duty, agreement or condition of this Agreement or to exercise any right or remedy consequent upon a breach thereof shall constitute a waiver of any such breach or of any other covenant, duty, agreement or condition. Any amendment to this Agreement shall be effective only if in a writing signed by each of the parties hereto. 5.04 Severability. If any provision of this Agreement is or becomes invalid, illegal or unenforceable in any respect, the validity, legality and enforceability of the remaining provisions hereof, or of such provision in other respects, shall not be affected thereby. 5.05 Governing Law. This Agreement shall be governed by and construed in accordance with the laws of the State of Delaware applicable to a contract executed and performed in such State, without giving effect to the conflicts of laws principles thereof. 5.06 Counterparts. This Agreement may be executed in any number of counterparts, each of which will be deemed an original, but all of which together will constitute one and the same instrument. IN WITNESS WHEREOF, each party hereto has caused this Agreement amending and restating the Prior Agreement to be signed by its officer duly authorized as of the date first above written. BUCKEYE MANAGEMENT COMPANY By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO BUCKEYE PARTNERS, L.P. By: BUCKEYE PIPE LINE COMPANY, as General Partner By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO BUCKEYE PIPE LINE COMPANY By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO BUCKEYE PIPE LINE COMPANY OF MICHIGAN, L.P. By: BUCKEYE PIPE LINE COMPANY, as General Partner By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO [SIGNATURES CONTINUE ONTO NEXT PAGE] [SIGNATURES CONTINUED FROM PREVIOUS PAGE] LAUREL PIPE LINE COMPANY, L.P. By: BUCKEYE PIPE LINE COMPANY, as General Partner By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO EVERGLADES PIPE LINE COMPANY, L.P. By: BUCKEYE PIPE LINE COMPANY, as General Partner By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO BUCKEYE PIPE LINE HOLDINGS, L.P. By: BUCKEYE PIPE LINE COMPANY, as General Partner By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO BUCKEYE PIPE LINE COMPANY, L.P. By: BUCKEYE PIPE LINE COMPANY, as General Partner By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO GLENMOOR, LTD. By: /s/ Steven C. Ramsey Name: Steven C. Ramsey Title: Senior V.P. Finance and CFO