Fix indexing with a variable.