<PAGE>

                                                                  Exhibit 10.147

                                  AMENDMENT OF
                                RIGHTS AGREEMENT
                                     BETWEEN
                            CASTLE ENERGY CORPORATION
                                       AND
                    AMERICAN STOCK TRANSFER AND TRUST COMPANY
                                 AS RIGHTS AGENT



WHEREAS, the Castle Energy Corporation, a Delaware Corporation (the
"Corporation") and American Stock Transfer & Trust Company (the "Rights Agent")
have entered into that certain Rights Agreement between Castle Energy
Corporation and American Stock Transfer and Trust Company as Rights Agent dated
as of April 23, 1994 (the "Rights Agreement"); and

WHEREAS FURTHER, the Corporation has determined that the definition of
"Acquiring Person" in the Rights Agreement unduly restricts the ability of
institutional investors to acquire and hold stock in the Corporation and that a
modification thereof is in the best interests of the shareholders of the
Corporation; and

WHEREAS FURTHER, the Corporation has delivered a certificate to the Rights Agent
which stating that this Amendment is in compliance with Section 27 of the Rights
Agreement.

Now therefore, the Corporation and the Rights Agent hereby agree to amend the
Rights Agreement as follows:

1. The existing definition of "Acquiring Person" in Section 1 (a) is deleted in
its entirety and the following is substituted in its stead:

                           (a) "Acquiring Person" shall mean any Person who or
         which, together with all Affiliates and Associates of such Person,
         shall be the Beneficial Owner of 15% or more of the then outstanding
         Common Shares (other than as a result of a Permitted Offer) or was such
         a Beneficial Owner at any time after the date hereof, whether or not
         such person continues to be the Beneficial Owner of 15% or more of the
         then outstanding Common Shares. Notwithstanding the foregoing,

         (i) the term "Acquiring Person" shall not include

                  (A) the Corporation,

                  (B) any Subsidiary of the Corporation,

                  (C) any employee benefit plan of the Corporation or of any
         Subsidiary of the Corporation,

                  (D) any Person or entity organized, appointed or established
         by the Corporation for or pursuant to the terms of any such plan,



<PAGE>


Amendment of Rights Agreement
Page 2 of 3

                  (E) any Person, who or which together with all Affiliates and
         Associates of such Person becomes the Beneficial Owner of 15% or more
         of the then outstanding Common Shares as a result of the acquisition of
         Common Shares directly from the Corporation, and

                  (F) any Person who is a Grandfathered Stockholder so long as
         such Person is and remains a Grandfathered Stockholder, and

         (ii) no Person shall be deemed to be an "Acquiring Person" either

                  (A) as a result of the acquisition of Common Shares by the
         Corporation which, by reducing the number of Common Shares outstanding,
         increases the proportional number of shares beneficially owned by such
         Person together with all Affiliates and Associates of such Person;
         except that if

                           (1)      a Person would become an Acquiring Person
                                    (but for the operation of this clause (A) as
                                    a result of the acquisition of Common Shares
                                    by the Corporation, and

                           (2)      after such shares acquisition by the
                                    Corporation, such Person, or an Affiliate or
                                    Associate of such Person, becomes the
                                    Beneficial Owner of any additional Common
                                    Shares, then such Person shall be deemed an
                                    Acquiring Person, or

                  (B) if

                           (1)      within eight (8) days after such Person
                                    would otherwise have become an Acquiring
                                    Person [but for the operation of this clause
                                    (B)], such Person notifies the Board of
                                    Directors that such Person did so
                                    inadvertently, and

                           (2)      within two (2) days after such notification,
                                    such Person, together with all Affiliates
                                    and Associates of such Person, is the
                                    Beneficial Owner of less than 15% of the
                                    outstanding Common Shares or is a
                                    Grandfathered Stockholder, or

                  (C) if such Person is an Institutional Investor, such
         Institutional Investor becomes the Beneficial Owner of 15% or more of
         the outstanding Common Shares solely by reason of such Institutional
         Investor's Regular Trading Activities; provided, however, that if an
         Institutional Investor becomes the Beneficial Owner of 25% or more of
         the then outstanding Common Shares other than solely as the result of
         the events described in clause (A) or (B) of this Section 1(a)(ii) (and
         in the case of clause (B), such Institutional Investor immediately
         divests itself of a sufficient number of Common Shares as that it is no
         longer the Beneficial Owner of 25% or more of the then outstanding
         Common Shares), then such Institutional Investor shall be deemed an
         "Acquiring Person."

2. A definition of "Institutional Investor" in a new Section 1 (l-1) shall be
added immediately prior to Section 1 (m) as follows:


<PAGE>


Amendment of Rights Agreement
Page 3 of 3


                           (l-1) "Institutional Investor" shall mean a Person
         who is principally engaged in the business of managing investment funds
         for unaffiliated securities investors and, as part of such Person's
         duties as agent for fully managed accounts, holds or exercises voting
         or dispositive power over Common Shares.

3. A definition of "Regular Trading Activities" and a new Section 1 (q-1) shall
be added immediately prior to Section 1 (r) as follows:

                           (q-1) "Regular Trading Activities" shall mean trading
         activities undertaken in the Institutional Investor's normal course of
         business and not for the purpose of exercising, either alone or in
         concert with any other Person, power to direct or cause the direction
         of the management and policies of the Corporation.

4. Other than as amended hereby, the Rights Agreement shall continue in full
force and effect.

         IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be
duly executed and attested, all as of the date hereinbelow written.


Dated as of December 31, 2002


Attest:                                     CASTLE ENERGY CORPORATION


By:                                         By:
   ----------------------------             ------------------------------------
Name: Susan Pyle                            Name: Richard E. Staedtler
Title: Secretary                            Title: Vice President


                                            AMERICAN STOCK TRANSFER &
Attest:                                     TRUST COMPANY


By:                                         By:
   ----------------------------             ------------------------------------
Name:                                       Name:
Title:                                      Title: