Fixes bug with 'i' introduced by last commit