Some fixes in templates