Fix JS and template