Fix JS syntax errors with the template.