Fixed the memory bug.