Correctly handle container class in template.