bug fixes on Windows