Many fixes needed to run from distro on windows