Fix a few small bugs in the dragging for issue #36.