Previously, the same variable 'i' was sometimes declared within a for loop and sometimes outside of the loop, all within the same function. This avoids spurious warnings in MSVC 2005.