Fixing bug: variable 'filename' is conflicting with iterator 'filename.'