Make links respect topology

Fixes #31.