Fixed cppcheck (style) warnings about reducing the variable scope.