NPE fix
Merge pull request #17 from amit-git/master

NPE fixes