fixes for templates