Fix javascript bug that comes from last cherry-pick commit.