Add protections against missing objects.