Fix JS bugs.