Windows: improve error reporting