bug fixes to win compile