Fixed memory bug.