Fix mingw builds, remove obsolete code.