Fix Windows build.

- Adapt to API changes.
- Fix of string manipulation.