Fixes to JS sdk
Merge pull request #301 from stianst/master

Fixes to JS sdk