Fixed Not_found error in diagnostics

For unused dependencies, we don't need to add notes about the
dependency's target.