fix some JS issues
merge master