Fixes for JS to install handlers only on specified elements