JavaScrips fixes