Fix menus, remove grep (#9248, #9249)

copy_if requires the destination to have room for the elements.
Making grep work in this case would require restricting it to
vectors: just remove it instead.