Fixed mingw python errors, and fixed broken tests (due to system changes)