Fix Windows build.

- Adapt to API changes.
- Fix of string manipulation.
- Compile out a switch case with no case but just a default (MSVC doesn't
  like this).