Add missing null checks.