Fixed bug in try_load_template()