Fixed simple bug with indexing.