AMENDMENT NO. 2 TO AMENDED AND RESTATED CREDIT FACILITY AGREEMENT and convertible noteS