HSA contributions made erroneously

After I turned 65 in September, I continued to make contributions to my HSA account, and to pay for my family’s medical expenses using that account.  It was only after I sat down to do our taxes that I discovered persons covered by Medicare are not eligible to contribute to an HSA account.  I have only Medicare Part A (no Part B), as I am covered under my (much younger) wife’s employer-sponsored health insurance.  The HSA institution has issued forms 5498-SA and 1099-SA.  How can I correct this, and still take advantage of the tax benefits for the contributions made prior to September?