bugfixes with auto (un)linking