Fixes duplicate code (syntax error) and cleans it up a bit
Removes exception if link already exists (same was as in TW code)
Merge pull request #588 from m038/CS-5101

Cs 5101