Minor fixes to JS
minor fixes to JS