Pre-rendered select with mixed options and optgroup

Added handling of options without optgroup when one or more optgroups are present for pre-rendered selects