Cant delete materials or function (corrupted? and driving me nuts)

I have a few materials that use the same material function.Overtime, i renamed some of the names of the materials(and probably of the material function).I also made copies of the materials as backups on which I continued to work.
Today I finished my final shader and decided to delete all of the ones I don’t need.
I cant…every shader i try to delete says its in use and it also says that is Externaly Referenced by the name of shaders that I already renamed or deleted before.I even cant delete the material function.

I checked the package for errors and there are none.No model is currently using the shaders.
So the shaders can not be deleted because at one point in time I changed the name of the original shaders and made copies of it with even more different names!?

I know i can just create a new package and new shader>and copy paste the original in the new.(did that and UDK actually tried to pull a similar stunt on me but it was able to delete.

Any ideas on how I can fix this? UDK never crashed on me while working with these shaders so the package should not be corrupted.But it acts like it? Why I cant delete them?

since you renamed things it’s likely you have some redirectors causing issues. have you tried the fixupredirects commandlet? it’s a bit painful because it will go through all the content (they improved it greatly in UE4), so maybe backup everything first

Thank you.I tried it in 2 udk builds but it didn’t worked.I think the package might be corrupted even if it doesn’t looks like it.I also have a lot of projects in the udk builds so its better just to make a new upk,new empty shader and copy paste the content from the old shader to the new shader in the new upk.
That in theory should fix it if im not mistaking.Than just delete the old upk.