small fixes for templates