Solve issue 1

Fix a simple for loop indexing error.