fixes to memory class