Fixed illegal file check to be case insensitive