Fix assignment issue from valgrind

valgrind found that assigning variables inside of array index calls were
misbehaving in clang versus gcc.