Fixed the generated code when multiple @OptionsMenu are declared in the class hierarchy

See #473