fixed many linking issues.