Mingw compilation fixes of i declaration in for loop