additional fixes for templates