Merge pull request #3950 from 9rnsr/fix13417

[REG2.066] Issue 13417 - segmentation fault when deduce template type
Merge pull request #3951 from 9rnsr/fix13424

[REG2.066] Issue 13424 - Initialization of delegate to do-nothing default causes segfault at runtime
Merge pull request #3957 from 9rnsr/2.066

Cherry-picking commits from master to 2.066 branch (for the minor release 2.066.1)