Fixed issue of DEBUG ifdefs skipping an important calculation that broke the code.