Fixed resource.AddFile

Great fix idea. I am going to add it to my master to hope for less issues.