Fixed #15053 -- Improved template extending algorithm.

unclear what changed in 1.8 from this annotation