Add some null-checks