Fixing javascript code.