Fix some more possible null pointer dereferences
Merge pull request #983 from lioncash/derefs

Fix some more possible null pointer dereferences