Fixes a FlattenException error when displaying the menu form