Upstream pull

Windows support required.