Fixed most linking issues.