Initial version of fix_templates.sh