Fixed assertion failure in VS debug mode