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