CONSENT AND AMENDMENT NO. 2 TO CREDIT AGREEMENT AND AMENDMENT NO. 1 TO GUARANTY AND SECURITY AGREEMENT