Fixed the filtering of files/dirs that have problematic characters in
their name.