Correct small problems with the javascript