Adding null checks.