Remove some redundant null checks.