Second Amended and Restated Rights Agreement Dated as of October 4, 2004