FOURTH AMENDMENT TO TERM LOAN, GUARANTY AND SECURITY AGREEMENT