Some linking bugfixes