Build on Windows platform fails

A few things need to be fixed; see commit messages.