Fixed bugs in link updating.