Fixes to templateprovider
fix
Merge remote-tracking branch 'upstream/master'