Fixed some linking errors