Fix errors while compiling js