Fix dbg assert (#4182)