Fixes to make it more buildable for windows