Fixing bug in EArrWrite optimization. Got the indices wrong.