js tweaks to match upstream