Fix indexing of References