Fix link deletion order.