fixes some more bugs around case handling