Avoid creating duplicate references for resources.