Some more changes for memory testing and some testing for it