Bugfix/loop on links causes exception

Fixes #36