Fix assign_template