I found that refresh was called twice when creating controlgroup widget. First from method _setType() and then from _init(). I used _initialRefresh property to determine if options are set when widget is created. I've checked that changing type with $().controlgroup('option', 'type', 'vertical') still works :) There should probably be test added.
I also added some small performance fixes:
Controlgroup: refresh was called twice when widget was created. Legen…
…d element is now created when it is needed.