Fixing errors in templates