Clean up link dragging.

Fixes #406 and #407