Small changes to resource unloading