Bugfixes for Templates