some bug fixes in JS
Merge branch 'site_consistency'