Fixed memory corruption problem.