Fixing bug in windows file iteration