fix global Template leak.
Merge branch 'hotfix/0.5.1'