[#2363] fix aggressive removal of debug code