Fix widget resizing and add test