Bugfixes
More templating