Fix javascript syntax errors