Some more dirty patches to see if we can make it windows compatible