Merge pull request #88 from aleno/master

Fix null dereference of pointers