Fixes some case bugs