SECOND AMENDED AND SECURITIES PURCHASE AGREEMENT