Fixed bug in validating widgets.