Fix debug memory overflows