Fix for locale dependent ignoreCase

JavaScript's toLowerCase() ignores locale information and as such this can result in some information getting lost.