Small improvement to element drag code.