Fixed a bug in dragend() when not dragging.