Bug fix for NPE
Merge pull request #14 from bhariharan/master

Bug fix for NPE