Tweak the resource disposal algorithm a bit to make it better