Fix up situations when a class has been deleted already but we still have cached dependency info. PR: 3958