Fixed invalid memory access.