WAIVER AND FIFTH AMENDMENT TO NOTE PURCHASE AGREEMENT AND FIRST AMENDMENT TO WARRANT