fix iteration variables with integer cast