(Bug 62716) Fixed bug in detecting unresolvable tpl targets.

* Fixes {{{{echo}}|foo}} and the snippets in the bug report.

Change-Id: I590b8675ea82c1d2b305dee750a4c378febfec07
Merge "(Bug 62716) Fixed bug in detecting unresolvable tpl targets."