made code compile under windows with level 4 warnings