Fixed bugs in the model selector

Added support in the model selector for groups and hidden elements