fix dbgcoding and dpgcoding bugs