[WIP] Changes to (almost) compile in windows