Actually fixed the NPE, I hope
Merge pull request #26 from pterolatypus/master

Actually fixed the NPE, I hope