Fix small bug in template install function