Add a more robust directory handling
Use case-insensitive match for filenames