Replaced fnmatch() with patmatch()