Tweaks to JavaScript