Fix indexing so that it actually indexes