Fix bug where case was not being converted for unique check