various adjustments to make it build under windows, whilst passing the new CRAN checks