Bugfixes for template rules including #225