Fixed small indexing bug