minor javascript corrections from the last commit