Add submenu icon to template and fix invalid index usage in template class