Fix mechanism of adding scripts in the template.