Support for Windows (and a few minor changes)