Updated debugging for memory counting.