lot of bug fixes in win port