Some ugly hacks to get a windows build working.