Fix Issue #51

Moved the optgroup code from init to createLi and reloadLi functions.