Remove some redundant null-pointer checks from code that must have