Fix template bug: a trainer can have a trainer, closes #108.