Fixed some errors in the javascript