Nullpointer fix.
Merge pull request #51 from h2000/patch-1

Nullpointer fix.