Removed duplicated code logic and free allocated WidgetLabel object.
Fixes #319.