small fixes in widget code