Static Analyzer: Dereference of null pointer

Fix Clang Static Analyzer warnings. See comment for #82