Added missing null checks
Merge remote-tracking branch 'upstream/master'