Fixed memory_alloc