msi: Adjust the types of loop variables.