Fixes to JS