Fix updating of links tables