Fixing memory bug.