Add do_compile option, fixed templated script errors