Fixed accessing array i global memory.