Fixed bug in memory reporting.
Updated debugging for memory counting.