"any of the foregoing" means "anything we talked about earlier" not "anything whatever".
They need the last part because copyright is a sticky thing. All copyrights stick with the owner unless they are a "work for hire" or very explicitly granted in exchange for some good consideration, and you can't simply declare something to be a "work for hire", even by contract--it has its own meaning in law and (even more so) judicial interpretation of law. In (a) they try to define what they'd like to be included in "work for hire", but if it came down to it, a judge might not agree, so they require you to explicitly assign rights to everything in (a) (and possibly b, c,... don't know what's omitted) just in case they don't have them already.
If there's nothing important between the two sections you quoted, then I believe the ownership of your invention would hinge on the judgment of whether your invention relates to the company's business. Also any applicable state laws, etc..
I'm not qualified to answer completely, and even a relevantly trained lawyer would need to know the state, but I think there's good reason for hope.