fixing memory reporting bugs