Fixed issues in templates