Remove accidental global variable |i|