Some tweaks to JS