Added MEM_init and MEM_delete functions.