Added asserts to mem