Fix vector indexing deprecation warning