Fixing javascript bugs.