|I cannot get that to build, the compiler does not know
DBG_NEW. But either way that is a rather complex class. However, I can see nothing obvious, I guess the only way to find the problem is via the debugger.
OK, with a bit of editing I got it to work and the output is correct (as far as I can see) in both cases.
So the issue must have something to do with what you are running, or your data.