Compile fixes for later merge. 

Thanks for the merge. Here are the required fixes for compile and linking.