Fix NullReferenceException
Merge pull request #7 from ermau/master

Fix NullReferenceException