Fix NPE
Merge pull request #221 from manolo/master

Fix NPE