Windows compile fixes and further R integration.