Change null check, branch g
Merge pull request #7 from lukeasrodgers/g
This fixes issue #7
(for good measure)