Fix bug in populate_widgets.