Issue 6539 - Incomprehensible error message with failed template instantiation

http://d.puremagic.com/issues/show_bug.cgi?id=6539