Fix use of wrong 'i' variable name