Fix menu-building loop