Bugfix. Forgot to increment index in loop.