Fix: link insertion is broken with auto cleanup after commands