Make sure i is initialised