Fixes to JS sdk