Fixes for templates