Bugfix for multiple links with aliased links

On some conditions were some links loosed because the 'return' statements killed the loop for all links.