FOURTH AMENDMENT TO CREDIT AGREEMENT, SECOND AMENDMENT TO SECURITY AGREEMENT AND WAIVER