Fix js bugs.