Fixed memory access error.