Fixed external linking issues