Fix template copying.