Fixes some dragging related bugs.