SECOND AMENDMENT TO, AND CONSENT AND WAIVER UNDER, CREDIT AGREEMENT AND SECURITY AGREEMENT