AMENDMENT No. 4 TO AMENDED AND RESTATED SECURITY AGREEMENT