Fix small indexing issue resulting in a crash