Clean out the reference fields if we cannot resolve an reference. Log an error when we cannot resolve a reference