SECOND AMENDMENT TO LOAN AGREEMENT, SECURED PROMISSORY NOTE AND SECURITY AGREEMENT