AMENDED AND RESTATED THIRD AMENDING AGREEMENT