Fix js syntax errors