Fixed call-stack manipulation and two other mistakes in the debug build.