Fix linking in tests