Add some null checks.