Fix bug caused by case-sensitive checks for non-case-sensitive scenarios