It already has been. I've made a fix for it probably a year ago from now. http://www.mediafire.com/?dc1oby9drxcw4d9. It doesn't merit being a mod either, so I haven't included a .mod file. Just overwrite the game files or make a .mod to use it. Unfortunately I officially deleted it awhile back and the script in that file is just something I pulled out of what I'm working on now, so either you deal with the changes I've made to it (some of which are quite significant) or you implement the fix yourself. If you want to implement them yourself then here is the script for it:
But does that just give cores back in the territory that was just conquered? I know you added the province control check-- but I've always found that to not work very well outside of wartime. Granted, the war has just ended... but have you tested it in a situation where the target owns other cores?