Windows portability changes contributed by Richard Christman.