Add and clean-up null-checks.