Improved dragging and resizing