Fixed some of the javascript problems for bug #8390.