Fix global i variable.