Merge "Properly check for null pointers"