Fix #1045
Make readme updates
Add missing undefined check
Add UT
Remove comment
Remove double comment
Merge pull request #1192 from andrerod/dev

Fix #1045 and #1146