Cleaned up some of the dragging code.