EXHIBIT 10.13 AMENDMENT # 2 TO LOAN AGREEMENT THIS AMENDMENT TO LOAN AGREEMENT (the "Loan Agreement") is made this 28th day of December, 2004, by and between LYLES DIVERSIFIED, INC., a California corporation ("Lyles") and PACIFIC ETHANOL, INC., a California corporation ("PEI"). RECITALS: --------- A. The parties entered into that certain Term Loan Agreement ("Loan Agreement") dated June 16, 2003. B. As amended by the "Amendment to Loan Agreement" signed by both parties and dated July 29, 2004, Paragraph 1.5 of the Loan Agreement granted Lyles the right to purchase up to a total of $1,500,000 worth of common shares of PEI at the fixed price of One and 50/100 Dollars ($1.50) per share up to and including March 31, 2005. The parties now desire to extend that date up until which Lyles may purchase common shares until June 30, 2005. NOW, THEREFORE, the parties agree as follows: 1. CLARIFICATION OF PARAGRAPH 1.5: The parties hereby amend Paragraph 1.5 and Paragraph 8.11 of the Loan Agreement to state in its entirety as follows: 1.5 RIGHT TO PURCHASE COMMON STOCK OR CONVERT DEBT TO COMMON STOCK: Lender shall have the right, at Lender's option, to purchase common stock or to convert up to $1,500,000 of the principal owing to common shares of Borrower. Any principal converted shall be considered paid on the date of conversion and shall cease to accrue interest as of that date. Lender may purchase for cash or by conversion of debt up to a total of $1,500,000 worth of common shares at the fixed price of One and 50/100 Dollars ($1.50) per share. Lender shall have no right pursuant to this Agreement to purchase common stock or convert debt to stock ownership after the loan has BEEN FULLY REPAID. The expiration date for the rights granted in this paragraph cannot be extended irrespective of any performance, or lack of performance, of Borrower under the Loan Documents. If Borrower intends to prepay the principal prior to maturity, Lender shall have the option to exercise its right to convert debt to common stock (as of the date of the proposed prepayment) in lieu of accepting the prepayment for up to THE AMOUNT OF CONVERSION STILL REMAINING UNDER THIS CLAUSE 8.11 INTEGRATED AGREEMENT: The Loan Documents constitute the entire and integrated agreement between Lendor and Borrower relating to the Term Loan and all matters addressed herein and supersede all prior negotiations, communications, understandings and commitments relating thereto, whether written or oral. Should Borrower fail to complete a merger or share exchange agreement with a public company OR FAIL TO FUND THE ETHANOL PLANT CONSTRUCTION AT MADERA BY APRIL 1, 2005, the parties agree that the terms of the loan shall revert to the terms set out in the Letter of Intent dated March 10, 2003, however, if such a merger OR PLANT FUNDING does occur the Summary of Terms with Secured Debt with Equity shall be of no force or effect. 2. No FURTHER AMENDMENTS: Parties do not intend any additional amendments to the Loan Agreement. All its terms and conditions shall continue in full force and effect unless and until they are amended according to its terms. 1 IN WITNESS WHEREOF, the parties hereto have caused this Loan Agreement to be executed as of the date first above written. LENDER: BORROWER: LYLES DIVERSIFIED, INC., PACIFIC ETHANOL, INC., a California corporation a California corporation By /s/ William M Lyles By /s/ Neil Koehler ------------------------------- ----------------------------- William M. Lyles, President Neil Koehler, CEO By /s/ William Lyles By /s/ Ryan Turner ------------------------------- ----------------------------- William Lyles, Vice-President Ryan Turner, Secretary/ COO 2