Solving a bug in the allocation of memory.