SECOND AMENDMENT TO THE MID PENN BANK AMENDED AND RESTATED DIRECTOR DEFERRED FEE AGREEMENT DATED JANUARY 1, 2005 AND AMENDED JUNE 28, 2007 FOR ALAN DAKEY This Second Amendment is adopted this 26 day of March, 2008, by MID PENN BANK, a state-chartered commercial bank located in Millersburg, Pennsylvania (the "Company"), and ALAN DAKEY (the "Director"). The Company and the Director executed the Amended and Restated Director Deferred Fee Agreement effective as of January 1, 2005 and a First Amendment was executed on June 28, 2007 (the "Agreement"). The undersigned hereby amend the Agreement for the purpose of updating the death benefit. Therefore, the following changes shall be made: SECTION 5.1.1 OF THE AGREEMENT SHALL BE DELETED IN ITS ENTIRETY AND REPLACED BY THE FOLLOWING: 5.1.1 AMOUNT OF BENEFIT. The benefit under this Section 5.1 is the Deferral Account balance at the Executive's death. IN WITNESS OF THE ABOVE, the Company and the Director hereby consent to this First Amendment. Director: MID PENN BANK /s/ Alan Dakey By /s/ [ILLEGIBLE] - ------------------------------ ------------------------------ ALAN DAKEY Title V. P. 1 SECOND AMENDMENT TO THE MID PENN BANK AMENDED AND RESTATED DIRECTOR DEFERRED FEE AGREEMENT DATED JANUARY 1, 2005 AND AMENDED JUNE 28, 2007 FOR ALAN DAKEY This Second Amendment is adopted this 26 day of March, 2008, by MID PENN BANK, a state-chartered commercial bank located in Millersburg, Pennsylvania (the "Company"), and ALAN DAKEY (the "Director"). The Company and the Director executed the Amended and Restated Director Deferred Fee Agreement effective as of January 1, 2005 and a First Amendment was executed on June 28, 2007 (the "Agreement"). The undersigned hereby amend the Agreement for the purpose of updating the death benefit. Therefore, the following changes shall be made: SECTION 5.1.1 OF THE AGREEMENT SHALL BE DELETED IN ITS ENTIRETY AND REPLACED BY THE FOLLOWING: 5.1.1 AMOUNT OF BENEFIT. The benefit under this Section 5.1 is the Deferral Account balance at the Executive's death. IN WITNESS OF THE ABOVE, the Company and the Director hereby consent to this First Amendment. Director: MID PENN BANK /s/ Alan Dakey By /s/ [ILLEGIBLE] - ------------------------------ ------------------------------ ALAN DAKEY Title V. P. 1 MID PENN BANK AMENDED AND RESTATED DIRECTOR DEFERRED FEE AGREEMENT THIS AMENDED AND RESTATED DIRECTOR DEFERRED FEE AGREEMENT ("Agreement") is effective the 1st day of January, 2005, by and among Mid Penn Bank, a state commercial bank located in Millersburg, Pennsylvania (the "Company"), Mid Penn Bancorp, Inc., a Pennsylvania corporation (the "Corporation") and Alan Dakey (the "Director"). WITNESSETH: WHEREAS, the Company and the Director entered into a certain Director Deferred Fee Agreement dated December 30, 2005; and WHEREAS, the Company and the Director wish to amend the Director Deferred Fee Agreement for compliance with Section 409A of the Internal Revenue Code ("Section 409A"); and WHEREAS, the Company wishes to encourage the Director to remain a member of the Company's Board of Directors, and the Company is willing to provide to the Director a deferred fee opportunity, the benefits of which will be payable from the Company's general assets. NOW, THEREFORE, in consideration of the mutual promises and covenants contained herein, the parties hereby agree as follows: ARTICLE 1 DEFINITIONS 1.1 DEFINITIONS. Whenever used in this Agreement, the following words and phrases shall have the meanings specified: 1.1.1 A Change in Control (other than one occurring by reason of an acquisition of the Company by Employee) shall be deemed to have occurred if the Board of Directors of the Company certifies on an objective basis that one of the 1 following has occurred: (A) a sale or other transfer of ownership of all or substantially all (50% or more of the total gross fair market value) of the assets of Company to any individual, corporation, partnership, trust, or other entity or organization (a "Person") or group of Persons acting in concert as a partnership or other group, other than a Person controlling, controlled by, or under common control with Company; (B) any Person or group of Persons acting in concert as a partnership or other group, other than a Person controlling, controlled by, or under common control with Company, acquires ownership of stock in Company, that together with stock held by such Person or group, constitutes more than 50 percent of the total fair market value or total voting power of the stock of Company, provided such Person or group did not own more than 50 percent of the total fair market value or total voting power of the stock of Company prior to such acquisition; or (C) the replacement of a majority of members of the Corporation's Board of Directors over any period of one year or less by directors whose appointment or election is not endorsed by a majority of the members of the Corporation's Board of Directors prior to the date of the appointment or election. Notwithstanding anything else to the contrary set forth in this Agreement, if (i) an agreement is executed by the Corporation or the Company providing for any of the transactions or events constituting a Change in Control as defined herein, and the agreement subsequently expires or is terminated without the transaction or event being consummated, and (ii) Director's membership on the Company's Board did not terminate during the period after the agreement and prior to such expiration or termination, for purposes of this Agreement it shall be as though such agreement was never executed and no Change in Control event shall be deemed to have occurred as a result of the execution of such agreement. 1.1.2 "CODE" means the Internal Revenue Code of 1986, as amended. 2 1.1.3 "CORPORATION" means Mid Penn Bancorp, Inc. 1.1.4 "DISABILITY" means the Director's inability to engage in any substantial gainful activity by reason of any medically determinable physical or mental impairment that can be expected to result in death or can be expected to last for a continuous period of not less than twelve (12) months. 1.1.5 "ELECTION FORM" means the Form attached as Exhibit A. 1.1.6 "FEES" means the total director fees payable to the Director. 1.1.7 "NORMAL BENEFIT AGE" means the Director's 70th birthday. 1.1.8 "NORMAL BENEFIT DATE" means the later of the Normal Benefit Age or the Director's Termination of Service. 1.1.9 "TERMINATION OF SERVICE" means the Director's ceasing to be a member of the Company's Board of Directors for any reason other than death. ARTICLE 2 ELECTIONS 2.1 DEFERRAL ELECTION. The Director shall make a deferral election under this Agreement by filing with the Company a signed Election Form. The Election Form shall set forth the amount of Fees to be deferred. The Election Form shall be effective to defer only Fees earned in the calendar year following the date the Election Form is received by the Company and shall be irrevocable as of the last day of the calendar year preceding the year for which the election is made. For years after 2006, Fees may be deferred up to a maximum amount of Eight Thousand Dollars ($8,000.00). 3 2.2 DEFERRAL ELECTION CHANGES 2.2.1 GENERALLY. An Election Form on file with the Company shall remain effective for future years, and shall become irrevocable as of December 31 of each immediately preceding year, until such time as the Director changes the deferral election by submitting a new Election Form; provided, however, that any such change shall not be effective until the calendar year following the year in which the new Election Form is received by the Company. 2.2.2 HARDSHIP. In the event of an unforeseeable emergency constituting a severe financial hardship of the Director or the Director's beneficiary resulting from an illness or accident of the Director or beneficiary, the Director's or beneficiary's spouse or the Director's or beneficiary's dependent (as defined in Code Section 152(a)); loss of the Director's or beneficiary's property due to casualty; or other similar extraordinary and unforeseeable circumstances arising as a result of events beyond the control of the Director or beneficiary, the Director, by written instructions to the Company, may cancel future deferrals under this Agreement. Subsequent to such cancellation, the Director may elect to make additional deferrals under this Agreement upon filing a new Election Form setting forth the amounts to be deferred; provided, however, that any such new election will not be effective before the beginning of the year following the year in which such election is made. 2.3 DISTRIBUTION ELECTIONS. The time at which benefits under this Agreement will be paid and their manner of distribution are specified below. The Director may not change the time or manner of benefit payment under this Agreement without the written approval of the Board of Directors of the Company. Any change in the time or form of benefit payment (i) may not take effect until at least 12 months after the date on which an election to make such change is received in writing by the Company and approved by the Board of Directors; (ii) in the case of an election related to a payment not attributable to death, disability or hardship, as provided in this Agreement, must defer payment for a period of not less than 5 years from the date such payment would otherwise have been made; and (iii) in the case of any election related 4 to a payment based upon a specified time or fixed schedule may not be made less than 12 months prior to the date of the first scheduled payment. For purposes of changing the time or form of benefits distribution, if the Director has elected in this Agreement an installment form of payment, the installments shall be treated as a single payment occurring on the date of the first installment, and subject to the other rules for changes in distribution elections as set forth above, the Director may elect to receive a lump sum payment five years after the first installment payment would otherwise have been made. Notwithstanding the foregoing, a Director may, on or before December 31, 2006, make distribution elections different from those previously made by the Director without regard to the limitations described in (i), (ii) and (iii) of this Section 2.3; provided, however, that the Director may not make any election that would have the effect of deferring payment to a later year of an amount that would otherwise be payable in 2006 or that would have the effect of causing a payment to be made in 2006 that would otherwise be paid after 2006, and any such purported election by the Director shall be ineffective. Similarly, a Director may, on or before December 31, 2007, make distribution elections different from those previously made by the Director without regard to the limitations described in (i), (ii) and (iii) of this Section 2.3; provided, however, that the Director may not make any election that would have the effect of deferring payment to a later year of an amount that would otherwise be payable in 2007 or that would have the effect of causing a payment to be made in 2007 that would otherwise be paid after 2007, and any such purported election by the Director shall be ineffective. ARTICLE 3 DEFERRAL ACCOUNT 3.1 ESTABLISHING AND CREDITING. The Company shall establish a Deferral Account on its books for the Director, and shall credit to the Deferral Account the following amounts: 3.1.1 DEFERRALS. The Fees deferred by the Director as of the time the Fees would have otherwise been paid to the Director. 3.1.2 INTEREST. Effective December 31, 2006 interest shall be compounded semi-annually on the account balance using an annual rate equal to the 5-year Treasury rate as of the last day of the immediately preceding calendar year plus two percent (2%). 5 3.2 STATEMENT OF ACCOUNTS. The Company shall provide to the Director, within one hundred twenty (120) days after each anniversary of this Agreement, a statement setting forth the Deferral Account balance. 3.3 ACCOUNTING DEVICE ONLY. The Deferral Account is solely a device for measuring amounts to be paid under this Agreement. The Deferral Account is not a trust fund of any kind. The Director is a general unsecured creditor of the Company for the payment of benefits. The benefits represent the mere Company promise to pay such benefits. The Director's rights are not subject in any manner to anticipation, alienation, sale, transfer, assignment, pledge, encumbrance, attachment, or garnishment by the Director's creditors. ARTICLE 4 LIFETIME BENEFITS 4.1 NORMAL TERMINATION BENEFIT. Upon the Director's Termination of Service on or after attainment of Normal Benefit Age, the Company shall pay to the Director the benefit described in this Section 4.1 in lieu of any other benefit under this Agreement. 4.1.1 AMOUNT OF BENEFIT. The benefit under this Section 4.1 is the Deferral Account balance at the Director's Termination of Service. 4.1.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the Director in [OPTION 1] a lump sum or [OPTION 2] equal monthly installments over_____ years commencing on the first day of the month following the Director's Normal Benefit Date. The Company shall continue to credit interest as described in Section 3.1.2 on the balance of the Deferral Account until all payments have been distributed. 4.2 EARLY TERMINATION BENEFIT. If the Director terminates service as a director before the Normal Benefit Age for reasons other than death or Disability, the Company shall pay to the Director the benefit described in this Section 4.2. in lieu of any other benefit under this Agreement. 4.2.1 AMOUNT OF BENEFIT. The benefit under this Section 4.2 is the Deferral 6 Account balance at the Director's Normal Benefit Age. Interest shall be credited to the account between the Director's date of Termination of Service and the Director's Normal Benefit Age as specified in Section 3.1.2. 4.2.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the Director in [OPTION 1] a lump sum or [OPTION 2] equal monthly installments over _______ years commencing on the first day of the month following the Director's Normal Benefit Age. The Company shall continue to credit interest as described in Section 3.1.2 on the balance of the Deferral Account until all payments have been distributed. 4.3 DISABILITY BENEFIT. Upon a certification of Disability as defined in Section 1.1.4 and prior to the Normal Benefit Age, the Company shall pay to the Director the benefit described in this Section 4.3 in lieu of any other benefit under this Agreement. 4.3.1 AMOUNT OF BENEFIT. The benefit under this Section 4.3 is the Deferral Account balance at the time of certification of Disability. 4.3.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the Director in [OPTION 1] a lump sum or [OPTION 2] equal monthly installments over _______ years commencing on the first day of the month following certification of the Director's Disability. The Company shall continue to credit interest as described in Section 3.1.2 on the balance of the Deferral Account until all payments have been distributed. 4.4 CHANGE IN CONTROL BENEFIT. Upon the Director's Termination of Service within two years after a Change in Control, the Company shall pay to the Director the benefit described in this Section 4.4 in lieu of any other benefit under this Agreement. 4.4.1 AMOUNT OF BENEFIT. The benefit under this Section 4.4 is the Deferral Account balance at the date of the Director's Termination of Service. 4.4.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the Director in 7 [OPTION 1] a lump sum or [OPTION 2] equal monthly installments over _______ years commencing on the first day of the month following the Director's Termination of Service. The Company shall continue to credit interest as described in Section 3.1.2 on the balance of the Deferral Account until all payments have been distributed. 4.5 HARDSHIP DISTRIBUTION. Upon the Company's determination (following petition by the Director) that the Director has suffered an unforeseeable emergency as described in Section 2.2.2, the Company shall distribute to the Director all or a portion of the Deferral Account balance as determined by the Company, but in no event shall the distribution amount exceed the amount reasonably necessary to satisfy the emergency need (which may include amounts necessary to pay any federal, state or local income taxes or penalties reasonably anticipated to result from the distribution). A distribution on account of unforeseeable emergency may not be made to the extent that such emergency is or may be relieved through reimbursement or compensation from insurance or otherwise, by liquidation of the Director's assets (to the extent the liquidation of such assets would not cause severe financial hardship) or by cessation of deferrals under Section 2.2.2, and determination of the amount reasonably necessary to satisfy the emergency need shall take into account any additional compensation available to the Director as a result of a cessation of deferrals. 4.6 Notwithstanding the foregoing, in the event that the Director is determined to be a specified employee, as defined in Section 409A, any payment that is made on account of a separation from service, as defined in Section 409A, shall be delayed to the date that is one day after six months from the date of the Director's separation from service. In the event that any installment payments are delayed pursuant to this Section 4.6, such delayed payments will be accumulated and paid in one lump sum on the delayed payment date and any remaining payments shall be made in accordance with the otherwise applicable schedule of payments. ARTICLE 5 DEATH BENEFITS 5.1 DEATH PRIOR TO COMMENCEMENT OF BENEFIT PAYMENTS. If the Director dies prior to 8 commencement of benefit payments, the Company shall pay to the Director's beneficiary the benefit described in this Section 5.1 in lieu of any other benefit under this Agreement. 5.1.1 AMOUNT OF BENEFIT. The benefit amount under Section 5.1 is the greater of the Deferral Account balance at the Director's death or Two Hundred Three Thousand One Hundred Dollars ($203,100). 5.1.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the beneficiary in [OPTION 1] a lump sum or [OPTION 2] equal monthly installments over _______ years commencing on the first day of the month following the Director's death. The Company shall continue to credit interest as described in Section 3.1.2 on the balance of the Deferral Account until all payments have been distributed. 5.2 DEATH DURING BENEFIT PERIOD. If the Director dies after benefit payments have commenced under this Agreement but before receiving all such payments, the Company shall pay the remaining benefits to the Director's beneficiary at the same time and in the same amounts they would have been paid to the Director had the Director survived. ARTICLE 6 BENEFICIARIES 6.1. BENEFICIARY DESIGNATIONS. The Director shall designate a beneficiary by filing a written designation with the Company. The Director may revoke or modify the designation at any time by filing a new designation. However, designations will only be effective if signed by the Director and accepted by the Company during the Director's lifetime. The Director's beneficiary designation shall be deemed automatically revoked if the beneficiary predeceases the Director, or if the Director names a spouse as beneficiary and the marriage is subsequently dissolved. If the Director dies without a valid beneficiary designation, all payments shall be made to the Director's estate. 6.2 FACILITY OF PAYMENT. If a benefit is payable to a minor, to a person declared incompetent, or to a person incapable of handling the disposition of his or her property, the 9 Company may pay such benefit to the guardian, legal representative or person having the care or custody of such minor, incompetent person or incapable person. The Company may require proof of incompetence, minority or guardianship as it may deem appropriate prior to distribution of the benefit. Such distribution shall completely discharge the Company from all liability with respect to such benefit. ARTICLE 7 GENERAL LIMITATIONS Notwithstanding anything in this Agreement to the contrary, all interest that would otherwise be credited to the Director's Deferral Account balance subsequent to the Director's Termination of Service or death, as applicable, shall be forfeited in the following circumstances: 7.1 TERMINATION FOR CAUSE. If the Company terminates the Director's service as a director for: 7.1.1 Gross negligence or gross neglect of duties; 7.1.2 Commission of a felony or of a gross misdemeanor involving moral turpitude; or 7.1.3 Fraud, disloyalty, dishonesty or willful violation of any law or significant Company policy committed in connection with the Director's service and resulting in an adverse financial effect on the Company. 7.2 SUICIDE. If the Director commits suicide within two years after the date of this Agreement, or if the Director has made any material misstatement of fact on any application for life insurance purchased by the Company. ARTICLE 8 CLAIMS AND REVIEW PROCEDURES 10 8.1 CLAIMS PROCEDURE. The Company shall notify any person or entity that makes a claim for benefits under this Agreement (the "Claimant") in writing, within ninety (90) days (forty-five (45) days in the case of a claim for disability benefits) of Claimant's written application for benefits, of Claimant's eligibility or ineligibility for benefits under the Agreement. If the Company determines that the Claimant is not eligible for benefits or full benefits, the notice shall set forth (1) the specific reasons for such denial, (2) a specific reference to the provisions of the Agreement on which the denial is based, (3) a description of any additional information or material necessary for the Claimant to perfect Claimant's claim, and a description of why it is needed, and (4) an explanation of the Agreement's claims review procedure and other appropriate information as to the steps to be taken if the Claimant wishes to have the claim reviewed. If the Company determines that there are special circumstances requiring additional time to make a decision, the Company shall notify the Claimant of the special circumstances and the date by which a decision is expected to be made, and may extend the time for up to an additional ninety-day period (thirty-day period for disability claims). 8.2 REVIEW PROCEDURE. If the Claimant is determined by the Company not to be eligible for benefits, or if the Claimant believes that Claimant is entitled to greater or different benefits, the Claimant shall have the opportunity to have such claim reviewed by the Company by filing a petition for review with the Company within sixty (60) days after receipt of the notice issued by the Company. Said petition shall state the specific reasons which the Claimant believes entitle Claimant to benefits or to greater or different benefits. Within sixty (60) days after receipt by the Company of the petition, the Company shall afford the Claimant (and counsel, if any) an opportunity to present Claimant's position to the Company orally or in writing, and the Claimant (or counsel) shall have the right to review the pertinent documents. The Company shall notify the Claimant of its decision in writing within the sixty-day period (forty-five (45) days in the case of a claim for disability benefits), stating specifically the basis of its decision, written in a manner calculated to be understood by the Claimant and the specific provisions of the Agreement on which the decision is based. If, because of the need for a hearing, the sixty-day period is not sufficient, the decision may be deferred for up to another sixty-day period (forty-five (45) days for disability claims) at the election of the Company, but notice of this deferral shall be given to the Claimant. 11 ARTICLE 9 AMENDMENTS AND TERMINATION This Agreement may be amended or terminated only by a written agreement signed by the parties; provided, however, that in the event that this Agreement is terminated, benefit payments shall be made as though no such termination occurred unless the termination satisfies the requirements of Section 409A pertaining to plan terminations allowing a change in the form or timing of benefit distributions. ARTICLE 10 MISCELLANEOUS 10.1 BINDING EFFECT. This Agreement shall bind the parties, and their beneficiaries, survivors, executors, administrators and transferees. 10.2 NO GUARANTEE OF SERVICE. This Agreement is not a contract for services. It does not give the Director the right to remain a director of the Company, nor does it interfere with the shareholders' rights to replace the Director. It also does not require the Director to remain a director nor interfere with the Director's right to terminate services at any time. 10.3 NON-TRANSFERABILITY. Benefits under this Agreement cannot be sold, transferred, assigned, pledged, attached or encumbered in any manner. 10.4 TAX WITHHOLDING. The Company shall withhold any taxes that are required to be withheld from the benefits provided under this Agreement. 10.5 APPLICABLE LAW. The Agreement and all rights hereunder shall be governed by the laws of the Commonwealth of Pennsylvania, except to the extent preempted by the laws of the United States of America. The provisions of this Agreement shall be construed consistent with Section 409A of the Internal Revenue Code and all applicable guidance thereunder so as not to result in the inclusion in the Director's income of any benefit under this Agreement by reason of the application of such section. 12 10.6 UNFUNDED ARRANGEMENT. The Director and beneficiary are general unsecured creditors of the Company for the payment of benefits under this Agreement. The benefits represent the mere promise by the Company to pay such benefits. The rights to benefits are not subject in any manner to anticipation, alienation, sale, transfer, assignment, pledge, encumbrance, attachment, or garnishment by creditors. Any insurance policy on the Director's life obtained by the Company shall be owned by the Company and shall confer no preferred or secured claim status to such policy or policy benefits on the Director or beneficiary. 10.7 REORGANIZATION. The Company shall not merge or consolidate into or with another company, or reorganize, or sell substantially all of its assets to another company, firm, or person unless such succeeding or continuing company, firm, or person agrees to assume and discharge the obligations of the Company under this Agreement. 10.8 ENTIRE AGREEMENT. This Agreement constitutes the entire agreement between the parties as to the subject matter hereof and supersedes all prior agreements relating to such subject. No rights are granted to the Director by virtue of this Agreement other than those specifically set forth herein. 10.9 ADMINISTRATION. The Company shall have powers which are necessary to administer this Agreement, including but not limited to: 10.9.1 Interpreting the provisions of the Agreement; 10.9.2 Establishing and revising the method of accounting for the Agreement; 10.9.3 Maintaining a record of benefit payments; and 10.9.4 Establishing rules and prescribing any forms necessary or desirable to administer the Agreement. IN WITNESS WHEREOF, the Director and a duly authorized Company officer have signed this Agreement. 13 DIRECTOR: COMPANY: MID PENN BANK /s/ Alan Dakey By: /s/ [ILLEGIBLE] - ------------------------------------ -------------------------------- Title: V. P. Human Resource Officer By execution hereof, Mid Perm Bancorp, Inc. consents to and agrees to be bound by the terms and conditions of this Agreement. ATTEST: CORPORATION: MID PENN BANCORP, INC. /s/ [ILLEGIBLE] By: /s/ [ILLEGIBLE] - ------------------------------------ -------------------------------- Title: Secretary 14