Fix for NPE
Merge pull request #206 from bhariharan/npe

Fix for NPE