Fixed MAX_MEM size and test cases to read and write from the test memory.