Improved case insensitivity with toLower function