Fix issues with link building