Fix several issues with dragging in the editor