Added a missing 'i' in the for loop. Fixes #280.