Fix 1797488: use set_link() rather than modifying the members directly.