Fix incorrect templates being extended.