Add default sorting of widgets. Fix #493