Fix sample code for widget.