Yep, I figured it probably have something to do with that.
Strange thing is that the code has been working fine with MCS for over 10 years but now it doesn't. So I've messed something up.