Make the link stuff actually work as intended

Forgot to test this properly. It's good now.