Fix resizing and dragging issues