Fix bug in link saving