Updated the code that generates a select widget.