New templates support. Bug fix.