Further fixes to memory
Working on test2 fixes