Fixed mac and linux build/link errors