Fixed a crash in debug mode under Windows