Fix Null Pointer Exception
Merge pull request #390 from josehsantos/origin/fix

[WIP] Fix Null Pointer Exception #389 + TEST